From 8808629f9e72a89fe4ba2002a4543fb7016bf754 Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Fri, 8 Apr 2022 08:52:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20There=20is=20no=20way=20the,=20idm=20?= =?UTF-8?q?=E7=99=BB=E9=99=86=E9=AA=8C=E8=AF=81=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B0=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/loginVerify/index.vue | 49 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/pages/loginVerify/index.vue b/src/pages/loginVerify/index.vue index 1641eea10..71523458f 100644 --- a/src/pages/loginVerify/index.vue +++ b/src/pages/loginVerify/index.vue @@ -30,7 +30,7 @@ getMenu () { return new Promise((resolve, reject) => { this.$http.get('sarUser/user/menu', { - userId: this.$store.getters.userInfo.userId, + userId: this.$store.getters.userInfo.userId, }, { _this: this, }, res => { @@ -117,7 +117,7 @@ mounted () { let url = window.location.search let code = ""; - if(url){ + if(url && url.indexOf("code") !== -1){ url = url.substr(1); url = url.split('&'); let info = []; @@ -129,27 +129,32 @@ } code = url[0].code } - let _formData = new FormData() - _formData.append('code', code === undefined ? "" : code) - loginIdm(_formData).then(res => { - if (res.ok) { - this.loginNew(res) - } else { - if(res.respCode && res.respCode === 'r0011'){ - this.$message.warning('系统无权限访问') - this.$store.dispatch('logout') - this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', { - confirmButtonText: '确定', - type: 'warning', - showClose: false, - showCancelButton: false, - }).then(() => { - window.location.href = ssoLogoutUrlDev - }) - // window.location.href = 'http://sso.foton.com.cn/logout?service=' + if(code !== undefined && code !== ""){ + let _formData = new FormData() + _formData.append('code', code === undefined ? "" : code) + loginIdm(_formData).then(res => { + if (res.ok) { + this.loginNew(res) + } else { + if(res.respCode && res.respCode === 'r0011'){ + this.$message.warning('系统无权限访问') + this.$store.dispatch('logout') + this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', { + confirmButtonText: '确定', + type: 'warning', + showClose: false, + showCancelButton: false, + }).then(() => { + window.location.href = ssoLogoutUrlDev + }) + // window.location.href = 'http://sso.foton.com.cn/logout?service=' + } } - } - }) + }) + }else { + this.$router.push('/home2') + // window.location.href = ssoLogoutUrlDev + } if (this.$store.state.laws_urm !== '') { this.isRemember = true