Commit 05fdedbc authored by 钟卫鹏's avatar 钟卫鹏

fix: 处理线上菜单无法显示问题

parent 7656f9bf
......@@ -74,4 +74,4 @@ const mountRouter = [
const router = isDev ? localRouter : mountRouter
export { router ,isDev};
export { router, isDev};
......@@ -10,7 +10,8 @@ import {
import OuterSider from './OuterSide'
import styles from '../styles/MenuSlider.less'
import { getRouters } from '@/utils/auth';
import { isDev } from '@/constants';
// import { isDev } from '@/constants';
import { isDev } from '../../../config/routes'
import menuIcon from '../../asserts/menuIcon/logo.png'
const { Sider } = Layout
const { SubMenu } = Menu;
......@@ -29,7 +30,6 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
const { menuData, pathname, currentSelectKey = [], openKeys = [], changeOpenKeys } = props
const [innerCollapsed, setInnerCollapsed] = useState(false)
let menuItemsCache = null
const getMenuRouter = (routes: any, pathname: any) => {
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0]
......
......@@ -3,7 +3,8 @@ import { Layout, Menu, Avatar, Image } from 'antd'
import { Link } from 'umi'
import styles from '../styles/MenuSlider.less'
import { getRouters } from '@/utils/auth'
import { isDev } from '@/constants'
// import { isDev } from '@/constants'
import { isDev } from '../../../config/routes'
import { observer, inject } from 'mobx-react';
import CustomIcon from './CustomIcon';
import Icon from '@ant-design/icons';
......@@ -22,13 +23,12 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
const { menuData, pathname = "/", currentRouter } = props
const authRouters = getRouters()
let defaultSelectedKeys = ""
const isAuthPath = (path) => {
if (isDev) {
// if (isDev) {
return true
} else {
return authRouters.includes(path)
}
// } else {
// return authRouters.includes(path)
// }
}
const getSubMenu = () => {
......@@ -40,7 +40,6 @@ 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,
......
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