65 lines
1.8 KiB
JavaScript
65 lines
1.8 KiB
JavaScript
|
|
import axios from "axios";
|
||
|
|
import submenu from "./submenuTop.vue";
|
||
|
|
import jsonData from '../../nav.json';
|
||
|
|
let axios_config = require("./config.json")
|
||
|
|
|
||
|
|
const components = {
|
||
|
|
submenu,
|
||
|
|
}
|
||
|
|
|
||
|
|
const data = function () {
|
||
|
|
return {
|
||
|
|
jsonData,
|
||
|
|
username: sessionStorage.getItem("username") || "未登陆"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function mounted() {
|
||
|
|
}
|
||
|
|
|
||
|
|
const methods = {
|
||
|
|
// TODO 进行配置交互点
|
||
|
|
handleSelect(key, keypath, items) {
|
||
|
|
console.log(key)
|
||
|
|
if (key == "1-2") {
|
||
|
|
axios({
|
||
|
|
method: "get",
|
||
|
|
url: "http://121.36.245.185:8656/api/permission/sso_user_logout/",
|
||
|
|
data: {
|
||
|
|
user_token: sessionStorage.getItem("user")
|
||
|
|
}
|
||
|
|
}).then(res => {
|
||
|
|
console.log(res)
|
||
|
|
})
|
||
|
|
sessionStorage.removeItem("user")
|
||
|
|
sessionStorage.removeItem("username")
|
||
|
|
this.$router.push(
|
||
|
|
{
|
||
|
|
path: "/login"
|
||
|
|
}
|
||
|
|
)
|
||
|
|
}
|
||
|
|
this.params.top_nav_param.submenuLevelOne.value.forEach(element => {
|
||
|
|
if (element.uuid == keypath[0]) {
|
||
|
|
if (element.children.length == 0) {
|
||
|
|
// 顶部导航进行交互识别
|
||
|
|
this.$emit('update-show', element.com_name)
|
||
|
|
} else {
|
||
|
|
element.children.forEach(item => {
|
||
|
|
if (item.uuid == keypath[1]) {
|
||
|
|
// 顶部导航进行交互识别
|
||
|
|
this.$emit('update-show', item.com_name)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default {
|
||
|
|
data: data,
|
||
|
|
methods: methods,
|
||
|
|
mounted: mounted,
|
||
|
|
components: components,
|
||
|
|
}
|