fix: rememberMe bug

This commit is contained in:
xingyu 2023-01-05 15:02:32 +08:00
parent efcbd1ab68
commit 15ef2dbf78
2 changed files with 12 additions and 8 deletions

View File

@ -47,7 +47,9 @@ export type LoginFormType = {
export const getLoginForm = () => {
const loginForm: LoginFormType = wsCache.get(LoginFormKey)
loginForm.password = decrypt(loginForm.password) as string
if (loginForm) {
loginForm.password = decrypt(loginForm.password) as string
}
return loginForm
}

View File

@ -215,13 +215,15 @@ const getTenantId = async () => {
}
//
const getCookie = () => {
const { username, password, rememberMe, tenantName } = authUtil.getLoginForm()
loginData.loginForm = {
...loginData.loginForm,
username: username ? username : loginData.loginForm.username,
password: password ? password : loginData.loginForm.password,
rememberMe: rememberMe ? true : false,
tenantName: tenantName ? tenantName : loginData.loginForm.tenantName
const loginForm = authUtil.getLoginForm()
if (loginForm) {
loginData.loginForm = {
...loginData.loginForm,
username: loginForm.username ? loginForm.username : loginData.loginForm.username,
password: loginForm.password ? loginForm.password : loginData.loginForm.password,
rememberMe: loginForm.rememberMe ? true : false,
tenantName: loginForm.tenantName ? loginForm.tenantName : loginData.loginForm.tenantName
}
}
}
//