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

修改基本布局

parent da40eadf
......@@ -86,6 +86,16 @@ const BasicMenu = [
component: 'BasicLayout',
name: 'Web5配置',
icon: 'icon-dashboard',
routes: [
{
path: '/web5/integration',
name: '集成网站',
},
{
path: '/web5/single',
name: '一般网站',
},
],
},
{
path: '/app',
......@@ -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 => {
/* eslint-disable no-unused-vars */
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
matchRoutes(props.route.routes, props.location.pathname);
......@@ -153,25 +153,7 @@ const BasicLayout = props => {
location={{
pathname,
}}
menuDataRender={menuDataProps => {
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;
}}
menuDataRender={() => BasicMenu}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path) {
return defaultDom;
......
......@@ -40,8 +40,13 @@ export default {
component: Welcome,
},
{
path: '/web5',
name: 'Web5配置',
path: '/web5/integration',
name: '集成网站',
component: Welcome,
},
{
path: '/web5/single',
name: '一般网站',
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