Files
fe_supplier_frontend/src/app.ts

11 lines
348 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');
2025-08-07 09:22:49 +08:00
const whiteList = ['/login', '/forgot', '/register/supplier', '/register/expert', '/403', '/404', '/ViewReviewPage'];
if (!token && !whiteList.includes(location.pathname)) {
history.replace('/login');
}
2025-07-09 14:01:45 +08:00
}