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()