Merge pull request #2247 from dataease/pr@dev@fix_default_login_type

fix: 默认登录方式无效
This commit is contained in:
fit2cloud-chenyw 2022-05-12 15:53:21 +08:00 committed by GitHub
commit d436b5bb71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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