Commit 6fbb9435 authored by xiexingan's avatar xiexingan

update

parent 13ec9701
This diff is collapsed.
...@@ -175,6 +175,61 @@ ...@@ -175,6 +175,61 @@
handleStation(id) { handleStation(id) {
console.log('站点id', id) console.log('站点id', id)
that.$http({
url: that.$http.adornUrl('/sys/menu/nav1'),
method: 'get',
params: id
}).then((data) => {
if (data && data.code === 0) {
if (!data.menuList || data.menuList.length === 0) {
that.$message.warning('无站点系统访问权限!')
return
}
that.loading = that.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
that.$router.replace({ path: data.menuList[0].list[0].path })
// 设置顶栏菜单
const lineMenu = JSON.parse(sessionStorage.getItem('menuList')) //线路站点菜单
let obj = JSON.parse(JSON.stringify(lineMenu[0]))
obj.title = '返回首页'
obj.name = '返回首页'
obj.list[0].name = '返回首页'
obj.list[0].title = '返回首页'
data.menuList.push(obj)
// data.menuList.unshift(lineMenu[0])
store.dispatch('d2admin/menu/headerSetAsync', data.menuList)
sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]'))
return data
} else {
sessionStorage.setItem('menuList', '[]')
sessionStorage.setItem('permissions', '[]')
// next()
}
}).then((data) => {
let t = null
if (t) {
clearTimeout(t)
}
if (data) {
t = setTimeout(() => {
that.$router.go(0)
}, 100)
}
that.$menu.checkScroll()
}).then(() => {
setTimeout(() => {
that.loading.close()
}, 1000)
}).catch((e) => {
console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue')
})
}, },
// ==================================== // ====================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment