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

fix: 修复首次进入无法访问首页

parent 1ddfbc6a
......@@ -93,7 +93,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0]
}
// const { formatMessage } = useIntl();
const basicInfo = getMenuData(props.route.routes, { locale: false })
const menuData = basicInfo.menuData ? basicInfo.menuData.filter(item => !item.redirect) : []
......
......@@ -40,6 +40,7 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
if (code && code === item.relationParentCode) {
defaultSelectedKeys = item.relationParentCode
}
!item.hideInMenu && isAuthPath(item.path) && subHeadMenus.push({
path: item.path,
title: item.name,
......@@ -66,7 +67,7 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
<ul className={styles.menuBox}>
{
siderMenu.map(item => (
!item.hideInMenu && <li key={item.key} className={defaultSelectedKeys === item.relationParentCode ? styles.currentItem : ''}>
<li key={item.key} className={defaultSelectedKeys === item.relationParentCode ? styles.currentItem : ''}>
<Link to={item.path}>
<CustomIcon type={item.icon} style={{width: 20, height: 20}}/>
<label>{item.title}</label>
......
......@@ -109,7 +109,8 @@ export const asyncRouter = async (routeLists: string[], routes: any[]) => {
asyncRouter(routeLists, item.routes)
} else {
// 参与权限校验的页面
if (item.path && !routeLists.includes(item.path)) {
// fix: 修复左侧菜单首页无法显示
if (item.path && !routeLists.includes(item.path) && item.path !== '/memberCenter/home') {
item.hideInMenu = true
item.noAuth = 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