[fix 87354] 登录-登录时先去获取公钥

This commit is contained in:
danshihao
2024-07-29 10:56:03 +08:00
parent c283eb6486
commit 4003744846
+7 -3
View File
@@ -278,7 +278,7 @@ export default {
Vue.ls.remove(ACCESS_TOKEN) Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData() this.getRouterData()
this.handleChangeCheckCode() this.handleChangeCheckCode()
this.getPublicKey() // 获取秘钥 // this.getPublicKey() // 获取秘钥
}, },
methods: { methods: {
...mapActions(['Login', 'Logout', 'PhoneLogin']), ...mapActions(['Login', 'Logout', 'PhoneLogin']),
@@ -295,8 +295,10 @@ export default {
const that = this const that = this
const loginParams = {} const loginParams = {}
that.loginBtn = true that.loginBtn = true
that.form.validateFields(['username', 'password', 'inputCode', 'rememberMe'], { force: true }, (err, values) => { that.form.validateFields(['username', 'password', 'inputCode', 'rememberMe'], { force: true }, async (err, values) => {
if (!err) { if (!err) {
// 获取公钥
await this.getPublicKey()
loginParams.remember_me = values.rememberMe loginParams.remember_me = values.rememberMe
loginParams.captcha = that.inputCodeContent loginParams.captcha = that.inputCodeContent
loginParams.checkKey = that.currdatetime loginParams.checkKey = that.currdatetime
@@ -379,8 +381,10 @@ export default {
// 获取RSA公钥 // 获取RSA公钥
getPublicKey () { getPublicKey () {
// 获取公钥 // 获取公钥
getRSAPublicKey().then(res => { return getRSAPublicKey().then(res => {
this.rsaPublicKey = res.result this.rsaPublicKey = res.result
}).catch(err => {
console.error(err)
}) })
}, },
loginSuccess () { loginSuccess () {