From 71fcc8c7285e380a3b57ea9a988fec6fdd4767a3 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 25 Jul 2022 14:26:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BC=81=E5=BE=AE=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=BA=93=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/login.vue b/src/pages/login.vue index e035264c..750742a3 100644 --- a/src/pages/login.vue +++ b/src/pages/login.vue @@ -51,7 +51,7 @@ export default { handleLogin() { this.$refs.loginForm.validate(v => { if (v) { - this.handleSignIn({...this.form, module, corpId}) + this.getSystem().then(({module, corpId}) => this.handleSignIn({...this.form, module, corpId})) } }) }, @@ -59,12 +59,12 @@ export default { this.$http.delete("/auth/token/logout").finally(() => this.logout()) }, handleSignIn(params) { - this.getSystem().then(({module, corpId}) => this.getToken({...params, module, corpId}).then(() => { + return this.getToken(params).then(() => { if (module != 'AppCountryAlbum') { this.getAccount({module}) } this.target ? uni.reLaunch({url: this.target}) : uni.navigateBack({}) - }).catch(() => 0)) + }).catch(() => 0) }, getSystem() { let {name: module, libPath} = this.currentApp, @@ -80,7 +80,7 @@ export default { module = 'wangge' } this.setModule(module) - return {corpId, module} + return Promise.resolve({corpId, module}) } }, onShow() { @@ -93,7 +93,6 @@ export default { this.getSystem().then(() => this.getCode().catch(err => { this.err = err })) - } } else { this.handleLogout()