Browse Source

调整记住密码逻辑;去掉推登时的密码清空

main
zhengzhou 3 years ago
parent
commit
e4e703830d
2 changed files with 11 additions and 6 deletions
  1. +2
    -2
      src/components/AppHeader/components/userCenter/UserCenter.tsx
  2. +9
    -4
      src/pages/login/index.tsx

+ 2
- 2
src/components/AppHeader/components/userCenter/UserCenter.tsx View File

@@ -67,8 +67,8 @@ function PopContent(props: PopContentProps) {

const tryLogout = useCallback(() => {
if (hidePop) hidePop();
storage.remove('account');
storage.remove('password');
// storage.remove('account');
// storage.remove('password');
confirm({
onOk() {
logout();


+ 9
- 4
src/pages/login/index.tsx View File

@@ -59,9 +59,14 @@ export default function Login() {
})
.success(() => {
// 记录账号密码
if (isClient && keepPass) {
storage.set('account', account, true);
storage.set('password', password, true);
if (isClient) {
if (keepPass) {
storage.set('account', account, true);
storage.set('password', password, true);
} else {
storage.remove('account');
storage.remove('password');
}
}
// history.push('/');
// window.location.href = '/';
@@ -69,7 +74,7 @@ export default function Login() {
refresh();
// window.location.reload();
});
}, [account, password]);
}, [account, password, keepPass]);

useEffect(() => {
setErrText('');


Loading…
Cancel
Save