Unverified 提交 d436b5bb authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

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

fix: 默认登录方式无效
...@@ -147,10 +147,12 @@ export default { ...@@ -147,10 +147,12 @@ export default {
localStorage.setItem('publicKey', res.data) localStorage.setItem('publicKey', res.data)
} }
}) })
defaultLoginType().then(res => { Promise.all([p1, p2, p3]).then(() => {
Promise.all([p1, p2, p3]).then(() => { defaultLoginType().then(res => {
if (res.success && res.data && this.loginTypes.includes(res.data)) { const result = res
this.loginForm.loginType = res.data 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.$nextTick(() => {
this.changeLoginType(this.loginForm.loginType) this.changeLoginType(this.loginForm.loginType)
}) })
...@@ -218,7 +220,6 @@ export default { ...@@ -218,7 +220,6 @@ export default {
password: encrypt(this.loginForm.password), password: encrypt(this.loginForm.password),
loginType: this.loginForm.loginType loginType: this.loginForm.loginType
} }
const publicKey = localStorage.getItem('publicKey')
this.$store.dispatch('user/login', user).then(() => { this.$store.dispatch('user/login', user).then(() => {
this.$router.push({ path: this.redirect || '/' }) this.$router.push({ path: this.redirect || '/' })
this.loading = false this.loading = false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论