fix: 默认登录方式无效

This commit is contained in:
fit2cloud-chenyw 2022-05-12 15:52:09 +08:00
parent 70e0fc9bd3
commit 0f015c764e

View File

@ -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