diff --git a/src/pages/loginVerifyNoEncryption/index.vue b/src/pages/loginVerifyNoEncryption/index.vue index 98db12ca3..0a3cf1066 100644 --- a/src/pages/loginVerifyNoEncryption/index.vue +++ b/src/pages/loginVerifyNoEncryption/index.vue @@ -22,6 +22,17 @@ } }, methods: { + logout(){ + this.$store.dispatch('logout') + this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', { + confirmButtonText: '确定', + type: 'warning', + showClose: false, + showCancelButton: false, + }).then(() => { + window.location.href = ssoLogoutUrlDev + }) + }, /** * @description: 获取菜单logout * @author: chenxiaoxi @@ -50,17 +61,47 @@ userInfoObj.userId = userInfoObj.usid window.sessionStorage.setItem('userInfoObj', userInfoObj); // del this.setToken(userInfoObj.token) // vuex存储token - // 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') + let userInfo = {} + for (let key in userInfoObj) { + if (key !== 'uname') { + userInfo[key] = userInfoObj[key] + } else { + userInfo.uName = userInfoObj[key] } - 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']), ...mapActions(['setMenu']) @@ -79,15 +120,7 @@ this.loginNew(res) } else { if(res.respCode && res.respCode === 'r0011'){ - this.$store.dispatch('logout') - this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', { - confirmButtonText: '确定', - type: 'warning', - showClose: false, - showCancelButton: false, - }).then(() => { - window.location.href = ssoLogoutUrlDev - }) + this.logout() } } })