feat: There is no way the, 配置公开搜索中心 外部访问 外部用户权限依旧以菜单ID权限判断
This commit is contained in:
@@ -22,6 +22,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
logout(){
|
||||||
|
this.$store.dispatch('logout')
|
||||||
|
this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'warning',
|
||||||
|
showClose: false,
|
||||||
|
showCancelButton: false,
|
||||||
|
}).then(() => {
|
||||||
|
window.location.href = ssoLogoutUrlDev
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 获取菜单logout
|
* @description: 获取菜单logout
|
||||||
* @author: chenxiaoxi
|
* @author: chenxiaoxi
|
||||||
@@ -50,17 +61,47 @@
|
|||||||
userInfoObj.userId = userInfoObj.usid
|
userInfoObj.userId = userInfoObj.usid
|
||||||
window.sessionStorage.setItem('userInfoObj', userInfoObj); // del
|
window.sessionStorage.setItem('userInfoObj', userInfoObj); // del
|
||||||
this.setToken(userInfoObj.token) // vuex存储token
|
this.setToken(userInfoObj.token) // vuex存储token
|
||||||
// this.$router.push('/home1')
|
let userInfo = {}
|
||||||
let routerUrl = localStorage.getItem("routerUrl");
|
for (let key in userInfoObj) {
|
||||||
let routerParam = localStorage.getItem("routerParam");
|
if (key !== 'uname') {
|
||||||
// 路由跳转
|
userInfo[key] = userInfoObj[key]
|
||||||
if(routerParam && routerParam !== ''){
|
} else {
|
||||||
const UA = navigator.userAgent.toLocaleLowerCase()
|
userInfo.uName = userInfoObj[key]
|
||||||
if (UA.match(/msie/) != null || UA.match(/trident/) != null) {
|
|
||||||
alert('为了最佳显示效果 请使用google chrome')
|
|
||||||
}
|
}
|
||||||
this.$router.push('/'+routerUrl)
|
|
||||||
}
|
}
|
||||||
|
this.setUserInfo(JSON.stringify((userInfo)))
|
||||||
|
// this.resetTime()
|
||||||
|
// 获取用户菜单
|
||||||
|
window.sessionStorage.setItem('userInfo', userInfo); // del
|
||||||
|
this.getMenu().then((menuList) => {
|
||||||
|
let hasHomeMenu = false
|
||||||
|
menuList.map((menuItem) => {
|
||||||
|
if (menuItem.id === 'asdfadf') {
|
||||||
|
hasHomeMenu = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
window.sessionStorage.setItem('hasHomeMenu', hasHomeMenu); // del
|
||||||
|
window.sessionStorage.setItem('menuList', menuList); // del
|
||||||
|
if (hasHomeMenu) {
|
||||||
|
this.setMenu(JSON.stringify(menuList)).then(res => {
|
||||||
|
// this.$router.push('/home1')
|
||||||
|
let routerUrl = localStorage.getItem("routerUrl");
|
||||||
|
let routerParam = localStorage.getItem("routerParam");
|
||||||
|
// 路由跳转
|
||||||
|
if(routerParam && routerParam !== ''){
|
||||||
|
const UA = navigator.userAgent.toLocaleLowerCase()
|
||||||
|
if (UA.match(/msie/) != null || UA.match(/trident/) != null) {
|
||||||
|
alert('为了最佳显示效果 请使用google chrome')
|
||||||
|
}
|
||||||
|
this.$router.push('/'+routerUrl)
|
||||||
|
}
|
||||||
|
}, e => {
|
||||||
|
this.logout()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.logout()
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
...mapMutations(['setToken', 'setUserInfo', 'resetTime', 'rememberPwd', 'setJESSCookie']),
|
...mapMutations(['setToken', 'setUserInfo', 'resetTime', 'rememberPwd', 'setJESSCookie']),
|
||||||
...mapActions(['setMenu'])
|
...mapActions(['setMenu'])
|
||||||
@@ -79,15 +120,7 @@
|
|||||||
this.loginNew(res)
|
this.loginNew(res)
|
||||||
} else {
|
} else {
|
||||||
if(res.respCode && res.respCode === 'r0011'){
|
if(res.respCode && res.respCode === 'r0011'){
|
||||||
this.$store.dispatch('logout')
|
this.logout()
|
||||||
this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'warning',
|
|
||||||
showClose: false,
|
|
||||||
showCancelButton: false,
|
|
||||||
}).then(() => {
|
|
||||||
window.location.href = ssoLogoutUrlDev
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user