【修改】d登录权限

This commit is contained in:
zhoulingpo
2023-05-16 17:02:55 +08:00
parent a376fce78f
commit e077e48f32
2 changed files with 36 additions and 27 deletions
+1 -19
View File
@@ -99,24 +99,6 @@ export default {
}
}
menuFun(menu)
debugger
if(menuData.length==0){
this.$api.login.logout().then(_ => {
this.$message.warning('暂无权限,请联系管理员授权')
this.$store.commit('saveUserInfo', null)
this.$store.commit('setHandleProcess', null)
this.$store.commit('savePathUrl', null)
this.$store.commit('removeDicts', null)
// var sevice = "http://"+window.location.host+"/";
// var serviceUrl = encodeURIComponent(sevice);
// 正式
// window.open("https://caddmuat.changan.com.cn/cas/logout?service=http://10.64.23.30:7766/home", '_self');
// 测试
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
this.$router.push('/login')
})
return
}else{
const treeData = menuData.map(item => ({
id: item.id,
parentId: item.parentId,
@@ -136,7 +118,7 @@ export default {
this.menuAllDate = Object.values(obj)
this.getMenu()
}
})
+35 -8
View File
@@ -111,15 +111,42 @@ export default {
res.data.roleIdList=res.data.roleEOList.map(item=>{
return item.id
})
this.$message.success('登录成功')
this.$store.commit('saveUserInfo', res.data)
this.getMarket().then((resx)=>{
this.$store.commit('setMarketpre', resx)
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
}).catch((resx)=>{
this.$store.commit('setMarketpre', '')
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
})
this.$api.menu.getSysMenu({ roleId: this.$store.getters.userInfo.roleIdList[0] }).then(({ data }) => {
if (data === null) {
data = []
}
data = data.sort((a, b) => a.sort - b.sort)
const menu = data.filter(item => item.belong && item.isButton == '0')
if(menu.length==0){
this.$api.login.logout().then(_ => {
this.$message.warning('暂无权限,请联系管理员授权')
this.$store.commit('saveUserInfo', null)
this.$store.commit('setHandleProcess', null)
this.$store.commit('savePathUrl', null)
this.$store.commit('removeDicts', null)
// var sevice = "http://"+window.location.host+"/";
// var serviceUrl = encodeURIComponent(sevice);
// 正式
// window.open("https://caddmuat.changan.com.cn/cas/logout?service=http://10.64.23.30:7766/home", '_self');
// 测试
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
this.$router.push('/login')
})
return
}else{
this.$message.success('登录成功')
this.getMarket().then((resx)=>{
this.$store.commit('setMarketpre', resx)
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
}).catch((resx)=>{
this.$store.commit('setMarketpre', '')
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
})
}
})
}).catch(err => {
this.verifyCode()