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

fix: 修复路由无效

parent 4fc3e47d
......@@ -23,6 +23,7 @@ const config: any = {
},
nodeModulesTransform: {
type: 'none',
exclude: []
},
routes,
extraBabelPlugins: [
......
......@@ -102,6 +102,11 @@ export const removeAuth = () => {
removeRouters()
}
const HOME_URL = [
'/',
'/memberCenter/home'
]
export const asyncRouter = async (routeLists: string[], routes: any[]) => {
for (let i = 0; i < routes.length; i++) {
const item = routes[i]
......@@ -110,7 +115,7 @@ export const asyncRouter = async (routeLists: string[], routes: any[]) => {
} else {
// 参与权限校验的页面
// fix: 修复左侧菜单首页无法显示
if (item.path && !routeLists.includes(item.path) && item.path !== '/memberCenter/home') {
if (item.path && !routeLists.includes(item.path) && !HOME_URL.includes(item.path)) {
item.hideInMenu = true
item.noAuth = true
}
......
......@@ -5,7 +5,7 @@
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"jsx": "react",
"jsx": "react-jsx",
"esModuleInterop": true,
"noImplicitAny": false,
"sourceMap": true,
......
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