瀏覽代碼

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

main
zhengzhou 3 年之前
父節點
當前提交
e4e703830d
共有 2 個文件被更改,包括 11 次插入6 次删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存