From 0f015c764e230fcb40b108bb497be2585d806759 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 12 May 2022 15:52:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=BB=98=E8=AE=A4=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/login/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index f8190d402e..fde59f6a7a 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -147,10 +147,12 @@ export default { localStorage.setItem('publicKey', res.data) } }) - defaultLoginType().then(res => { - Promise.all([p1, p2, p3]).then(() => { - if (res.success && res.data && this.loginTypes.includes(res.data)) { - this.loginForm.loginType = res.data + Promise.all([p1, p2, p3]).then(() => { + defaultLoginType().then(res => { + const result = res + console.log('default login type is :' + res.data) + if (result.success && result.data && this.loginTypes.includes(result.data)) { + this.loginForm.loginType = result.data this.$nextTick(() => { this.changeLoginType(this.loginForm.loginType) }) @@ -218,7 +220,6 @@ export default { password: encrypt(this.loginForm.password), loginType: this.loginForm.loginType } - const publicKey = localStorage.getItem('publicKey') this.$store.dispatch('user/login', user).then(() => { this.$router.push({ path: this.redirect || '/' }) this.loading = false