Skip to content

Commit

Permalink
fix: 无凭证首次进入后台出现登录失效 #46
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Sep 13, 2022
1 parent d1cd10c commit 6af8093
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/admin/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export async function getInitialState() {
}
}; // 如果不是登录页面,执行
let option = {};
if (history.location.pathname == loginPath || history.location.pathname == '/init') {
if (
history.location.pathname == loginPath ||
history.location.pathname == '/init' ||
!localStorage.getItem('token')
) {
option.skipErrorHandler = true;
}
const initData = await fetchInitData(option);
Expand Down

0 comments on commit 6af8093

Please sign in to comment.