diff --git a/src/views/login/normalLogin.vue b/src/views/login/normalLogin.vue index 485c4a16c..6de8c678f 100644 --- a/src/views/login/normalLogin.vue +++ b/src/views/login/normalLogin.vue @@ -203,9 +203,18 @@ export default { if (orgList.length < 2) { if (orgList.length === 1) { orgId = orgList[0].orgId; - selectOrgnization(orgId); + selectOrgnization(orgId).then(() => { // 先登入组织,再跳转路由(跳转路由会获取用户信息,可能拿不到组织信息) + this.handleLoginSucessRoute(); + }).catch(err => { + this.loading = false; + this.tipsMsg = `登入组织失败!,${err.message}`; + setTimeout(() => { + this.tipsMsg = ''; + }, 5000); + }); + } else { + this.handleLoginSucessRoute(); } - this.handleLoginSucessRoute(); } else { this.$emit('showOrgList', orgList); } @@ -216,8 +225,17 @@ export default { }, // 选择组织 selectOrg(orgId) { - this.handleLoginSucessRoute(); - selectOrgnization(orgId); + // this.handleLoginSucessRoute(); + // selectOrgnization(orgId); + selectOrgnization(orgId).then(() => { // 先登入组织,再跳转路由(跳转路由会获取用户信息,可能拿不到组织信息) + this.handleLoginSucessRoute(); + }).catch(err => { + this.loading = false; + this.tipsMsg = `登入组织失败!,${err.message}`; + setTimeout(() => { + this.tipsMsg = ''; + }, 5000); + }); }, // 跳转路由 handleLoginSucessRoute() {