Commit c5029e04 authored by 左玲玲's avatar 左玲玲 😬

1539

parent d82b6972
...@@ -152,16 +152,10 @@ export const layout = ({ initialState, setInitialState }) => { ...@@ -152,16 +152,10 @@ export const layout = ({ initialState, setInitialState }) => {
noFound: <div>noFound</div>, noFound: <div>noFound</div>,
// 增加一个 loading 的状态 // 增加一个 loading 的状态
childrenRender: (children, props) => { childrenRender: (children, props) => {
let home, items = initialState?.newMenu?.userHavePermList ?? [];
if (history.location.pathname != "/welcome" && history.location.pathname != "/") {
home = history.location.pathname
} else {
home = items?.length > 0 ? items[0].path.indexOf("/") > -1 ? items[0].path : items[0]?.routes?.length > 0 ? items[0]?.routes[0]?.path : "" : "";
}
return ( return (
<> <>
{initialState?.currentUser && location.pathname !== loginPath ? ( {initialState?.currentUser && location.pathname !== loginPath ? (
<TagView home={home}>{children}</TagView> <TagView home='/welcome'>{children}</TagView>
) : ( ) : (
children children
)} )}
......
...@@ -56,7 +56,7 @@ let CardItems = (datav, i, getstar, addHistory) => { ...@@ -56,7 +56,7 @@ let CardItems = (datav, i, getstar, addHistory) => {
)} )}
</div> </div>
); );
}, },
coles = { xs: 24, sm: 24, md: 12, lg: 8, xl: 6, xxl: 4 }; coles = { xs: 24, sm: 24, md: 12, lg: 8, xl: 6, xxl: 4 };
function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile, name, menuData }) { function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile, name, menuData }) {
...@@ -169,7 +169,6 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile, ...@@ -169,7 +169,6 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
}; };
}); });
}, [collectPerm]); }, [collectPerm]);
return ( return (
<Sider <Sider
trigger={null} trigger={null}
...@@ -237,6 +236,12 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile, ...@@ -237,6 +236,12 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
label: '产品与服务', label: '产品与服务',
type: 'sub1', type: 'sub1',
}, },
{
key: '/welcome',
label: '首页',
type: 'sub1',
icon: <Ant4Icons.HomeOutlined />
},
...collectList, ...collectList,
]} ]}
/> />
......
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