去掉无用组件以及修改准入评审列表接口,增加token 验证白名单
This commit is contained in:
10
src/app.ts
10
src/app.ts
@ -1,10 +1,10 @@
|
||||
import { history } from 'umi';
|
||||
|
||||
export function onRouteChange({ location }: any) {
|
||||
// const token = localStorage.getItem('token');
|
||||
// const whiteList = ['/login', '/user/register', '/403', '/404'];
|
||||
// if (!token && !whiteList.includes(location.pathname)) {
|
||||
// history.replace('/login');
|
||||
// }
|
||||
const token = sessionStorage.getItem('token');
|
||||
const whiteList = ['/login', '/user/register', '/403', '/404'];
|
||||
if (!token && !whiteList.includes(location.pathname)) {
|
||||
history.replace('/login');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user