diff --git a/src/layout/index.vue b/src/layout/index.vue index c361505..9cede3f 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -84,7 +84,7 @@ export default { }), }, created() { - /* if (/wxwork/i.test(navigator.userAgent)) { + if (/wxwork/i.test(navigator.userAgent)) { // 在企业微信中打开 } else { // 不在企业微信中打开,可以做一些限制或提示 @@ -93,7 +93,7 @@ export default { // 或者重定向到其他页面 return // window.location.href = 'https://your-company-wechat-url' - } */ + } this.handleInit() this.handleAlive() }, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 3855bb3..b2ff6d2 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -115,7 +115,7 @@ export default { }, created() { // 是否禁止网页登录 - /* isProhibited().then((res) => { + isProhibited().then((res) => { if (res.data) { console.log(res.data, 'isProhibited') if (/wxwork/i.test(navigator.userAgent)) { @@ -129,7 +129,7 @@ export default { return } } - }) */ + }) // 租户开关 // this.tenantEnable = getTenantEnable(); // if (this.tenantEnable) { @@ -155,15 +155,6 @@ export default { // // 发送code获取成员信息 sendCode({ code: this.code, state: this.state, type: 40 }) .then(async (res) => { - if (res.data.code == 500) { - /* Toast.loading({ - duration: 3, // 持续展示 toast - forbidClick: false, - message: res.data.msg, - }) */ - this.firstLogin = true - return - } await setToken(res.data) await this.$store.dispatch( 'common/user/setAuthorization', @@ -186,7 +177,16 @@ export default { window.location.href = process.env.VUE_APP_BASE_API + '/#/home' }) .catch((error) => { - console.log(error, 'error') + this.$loading(false) + Toast({ + duration: 3000, // 持续展示 toast + forbidClick: false, + message: '请输入账号密码首次绑定', + }) + this.firstLogin = true + this.$nextTick(() => { + return + }) }) } },