Commit 3640a15a authored by 前端-许佳敏's avatar 前端-许佳敏

对"/"路由进行权限校验

parent 45d762f2
......@@ -33,7 +33,7 @@ const whiteLists = [
...userLoginLists,
// ...mallLists,
// '/memberCenter',
// '/',
'/',
'/memberCenter/noAuth',
'/403',
'/404',
......@@ -76,6 +76,12 @@ export function patchRoutes({ routes }: IRoutes) {
export function render(oldRender: Function) {
const { pathname } = history.location
// fix: 直接进入根路由导致无法访问后台首页
if (pathname === '/') {
history.replace('/memberCenter/home')
return;
}
// 白名单页面不进行权限校验
if (whiteLists.includes(pathname)) {
oldRender()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment