🎈 perf:避免表单值被后续函数修改导致页面异常
parent
d3f38c690e
commit
16c919ce02
|
@ -276,10 +276,11 @@ const handleLogin = async (params) => {
|
||||||
const code = route?.query?.code as string
|
const code = route?.query?.code as string
|
||||||
const state = route?.query?.state as string
|
const state = route?.query?.state as string
|
||||||
|
|
||||||
|
const loginDataLoginForm = { ...loginData.loginForm }
|
||||||
const res = await LoginApi.login({
|
const res = await LoginApi.login({
|
||||||
// 账号密码登录
|
// 账号密码登录
|
||||||
username: loginData.loginForm.username,
|
username: loginDataLoginForm.username,
|
||||||
password: loginData.loginForm.password,
|
password: loginDataLoginForm.password,
|
||||||
captchaVerification: params.captchaVerification,
|
captchaVerification: params.captchaVerification,
|
||||||
// 社交登录
|
// 社交登录
|
||||||
socialCode: code,
|
socialCode: code,
|
||||||
|
@ -294,8 +295,8 @@ const handleLogin = async (params) => {
|
||||||
text: '正在加载系统中...',
|
text: '正在加载系统中...',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
if (loginData.loginForm.rememberMe) {
|
if (loginDataLoginForm.rememberMe) {
|
||||||
authUtil.setLoginForm(loginData.loginForm)
|
authUtil.setLoginForm(loginDataLoginForm)
|
||||||
} else {
|
} else {
|
||||||
authUtil.removeLoginForm()
|
authUtil.removeLoginForm()
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,8 +249,9 @@ const handleLogin = async (params) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
loginData.loginForm.captchaVerification = params.captchaVerification
|
const loginDataLoginForm = { ...loginData.loginForm }
|
||||||
const res = await LoginApi.login(loginData.loginForm)
|
loginDataLoginForm.captchaVerification = params.captchaVerification
|
||||||
|
const res = await LoginApi.login(loginDataLoginForm)
|
||||||
if (!res) {
|
if (!res) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -259,8 +260,8 @@ const handleLogin = async (params) => {
|
||||||
text: '正在加载系统中...',
|
text: '正在加载系统中...',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
if (loginData.loginForm.rememberMe) {
|
if (loginDataLoginForm.rememberMe) {
|
||||||
authUtil.setLoginForm(loginData.loginForm)
|
authUtil.setLoginForm(loginDataLoginForm)
|
||||||
} else {
|
} else {
|
||||||
authUtil.removeLoginForm()
|
authUtil.removeLoginForm()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue