Skip to content

Commit

Permalink
feat: 未登录过时进入首页直接调整登录页
Browse files Browse the repository at this point in the history
  • Loading branch information
lingting committed Nov 9, 2022
1 parent 8cd6b4a commit c246b47
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/utils/NotifyUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const logoutHandler = () => {
cleanCache();
const { pathname } = history.location;
history.replace(`${login_uri}?redirect=${pathname}`);
Token.clean();
User.clean();
logoutModal = undefined;
Modal.destroyAll();
};
Expand Down Expand Up @@ -53,8 +55,12 @@ const Notify = {
return;
}

Token.clean();
User.clean();
// 如果没有缓存过token - 未登录过.
if (!Token.get()) {
// 直接跳转到登录页
logoutHandler();
return;
}

if (!logoutModal) {
Modal.destroyAll();
Expand Down

0 comments on commit c246b47

Please sign in to comment.