Files
fe_supplier_frontend/src/app.ts

11 lines
295 B
TypeScript
Raw Normal View History

2025-07-09 14:01:45 +08:00
import { history } from 'umi';
export function onRouteChange({ location }: any) {
const token = sessionStorage.getItem('token');
const whiteList = ['/login', '/user/register', '/403', '/404'];
if (!token && !whiteList.includes(location.pathname)) {
history.replace('/login');
}
2025-07-09 14:01:45 +08:00
}