Commit e1b03f13 authored by 陈前坚's avatar 陈前坚

修改基本布局

parent da40eadf
...@@ -86,6 +86,16 @@ const BasicMenu = [ ...@@ -86,6 +86,16 @@ const BasicMenu = [
component: 'BasicLayout', component: 'BasicLayout',
name: 'Web5配置', name: 'Web5配置',
icon: 'icon-dashboard', icon: 'icon-dashboard',
routes: [
{
path: '/web5/integration',
name: '集成网站',
},
{
path: '/web5/single',
name: '一般网站',
},
],
}, },
{ {
path: '/app', path: '/app',
...@@ -117,24 +127,14 @@ const BasicMenu = [ ...@@ -117,24 +127,14 @@ const BasicMenu = [
], ],
}, },
]; ];
const basicUrl = 'http://localhost:8080/Cityinterface/rest/services/OMS.svc/'; const userMode = localStorage.getItem('userMode');
if (userMode == 'common') {
BasicMenu.shift();
}
const BasicLayout = props => { const BasicLayout = props => {
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
const [pathname, setPathname] = useState('/welcome'); const [pathname, setPathname] = useState('/welcome');
const [menuData, setMenuData] = useState([]);
console.log(props);
useEffect(() => {
fetch(`${basicUrl}U_GetOUTree?_version=9999`)
.then(response => response.json())
.then(data => {
const userMode = localStorage.getItem('userMode');
if (userMode == 'common') {
BasicMenu.shift();
}
setMenuData(BasicMenu || []);
});
}, []);
const handleMenuCollapse = () => {}; // get children authority const handleMenuCollapse = () => {}; // get children authority
matchRoutes(props.route.routes, props.location.pathname); matchRoutes(props.route.routes, props.location.pathname);
...@@ -153,25 +153,7 @@ const BasicLayout = props => { ...@@ -153,25 +153,7 @@ const BasicLayout = props => {
location={{ location={{
pathname, pathname,
}} }}
menuDataRender={menuDataProps => { menuDataRender={() => BasicMenu}
console.log(menuDataProps);
menuDataProps.forEach(item => {
if (item.name == '机构列表') {
console.log('机构列表');
axios.get(`${basicUrl}U_GetOUTree?_version=9999`).then(result => {
console.log(result.data);
item.routes = [
{
path: '/ou/orgList',
name: '机构列表11',
},
];
});
}
});
return menuData;
}}
menuItemRender={(menuItemProps, defaultDom) => { menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path) { if (menuItemProps.isUrl || !menuItemProps.path) {
return defaultDom; return defaultDom;
......
...@@ -40,8 +40,13 @@ export default { ...@@ -40,8 +40,13 @@ export default {
component: Welcome, component: Welcome,
}, },
{ {
path: '/web5', path: '/web5/integration',
name: 'Web5配置', name: '集成网站',
component: Welcome,
},
{
path: '/web5/single',
name: '一般网站',
component: Welcome, component: Welcome,
}, },
{ {
......
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