Commit d9fe2826 authored by 邓晓峰's avatar 邓晓峰

fix: menu load bug

parent c0f6d3f5
Pipeline #23146 skipped with stages
...@@ -7177,9 +7177,9 @@ ...@@ -7177,9 +7177,9 @@
} }
}, },
"@wisdom-utils/utils": { "@wisdom-utils/utils": {
"version": "0.0.29", "version": "0.0.30",
"resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.29.tgz", "resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.30.tgz",
"integrity": "sha512-djsx6KVrpslN8/lJiMNz1zriNDiRJQfXZxH1jaxe+zQZ2+LxIJhO5ZvbjkGQM1CnQdn0BtoX1XuK/R5RI5FqYg==", "integrity": "sha512-CT7/PSIq+rELxei5/wXOHkHij5epIYPcJMRQ8FTn45SQQzYSiz3TYu9o30QfMOqUV2NlY5E7CNAGxCbg5zz09w==",
"requires": { "requires": {
"axios": "^0.21.1", "axios": "^0.21.1",
"cookie": "^0.4.1", "cookie": "^0.4.1",
...@@ -7585,13 +7585,13 @@ ...@@ -7585,13 +7585,13 @@
"dev": true "dev": true
}, },
"antd": { "antd": {
"version": "4.10.1", "version": "4.11.2",
"resolved": "https://g.civnet.cn:4873/antd/-/antd-4.10.1.tgz", "resolved": "https://g.civnet.cn:4873/antd/-/antd-4.11.2.tgz",
"integrity": "sha1-rTkPU11D5+HULTFrPULZ4PbkJiY=", "integrity": "sha1-KMIECeLRhtiRXNxurPHPsrgtm1s=",
"dev": true, "dev": true,
"requires": { "requires": {
"@ant-design/colors": "^5.0.0", "@ant-design/colors": "^5.0.0",
"@ant-design/icons": "^4.3.0", "@ant-design/icons": "^4.4.0",
"@ant-design/react-slick": "~0.28.1", "@ant-design/react-slick": "~0.28.1",
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
"array-tree-filter": "^2.1.0", "array-tree-filter": "^2.1.0",
...@@ -7599,15 +7599,14 @@ ...@@ -7599,15 +7599,14 @@
"copy-to-clipboard": "^3.2.0", "copy-to-clipboard": "^3.2.0",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"moment": "^2.25.3", "moment": "^2.25.3",
"omit.js": "^2.0.2",
"rc-cascader": "~1.4.0", "rc-cascader": "~1.4.0",
"rc-checkbox": "~2.3.0", "rc-checkbox": "~2.3.0",
"rc-collapse": "~3.1.0", "rc-collapse": "~3.1.0",
"rc-dialog": "~8.5.1", "rc-dialog": "~8.5.1",
"rc-drawer": "~4.2.0", "rc-drawer": "~4.2.0",
"rc-dropdown": "~3.2.0", "rc-dropdown": "~3.2.0",
"rc-field-form": "~1.17.3", "rc-field-form": "~1.18.0",
"rc-image": "~5.0.2", "rc-image": "~5.1.1",
"rc-input-number": "~6.1.0", "rc-input-number": "~6.1.0",
"rc-mentions": "~1.5.0", "rc-mentions": "~1.5.0",
"rc-menu": "~8.10.0", "rc-menu": "~8.10.0",
...@@ -7628,12 +7627,27 @@ ...@@ -7628,12 +7627,27 @@
"rc-tooltip": "~5.0.0", "rc-tooltip": "~5.0.0",
"rc-tree": "~4.1.0", "rc-tree": "~4.1.0",
"rc-tree-select": "~4.3.0", "rc-tree-select": "~4.3.0",
"rc-trigger": "^5.2.1",
"rc-upload": "~3.3.4", "rc-upload": "~3.3.4",
"rc-util": "^5.6.6", "rc-util": "^5.7.0",
"scroll-into-view-if-needed": "^2.2.25", "scroll-into-view-if-needed": "^2.2.25",
"warning": "^4.0.3" "warning": "^4.0.3"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons": {
"version": "4.4.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2ficons/-/icons-4.4.0.tgz",
"integrity": "sha1-1OS6WRBFTh0/Z6gC0qrZ7nWlHeo=",
"dev": true,
"requires": {
"@ant-design/colors": "^5.0.0",
"@ant-design/icons-svg": "^4.0.0",
"@babel/runtime": "^7.11.2",
"classnames": "^2.2.6",
"insert-css": "^2.0.0",
"rc-util": "^5.0.1"
}
},
"lodash": { "lodash": {
"version": "4.17.20", "version": "4.17.20",
"resolved": "https://g.civnet.cn:4873/lodash/-/lodash-4.17.20.tgz", "resolved": "https://g.civnet.cn:4873/lodash/-/lodash-4.17.20.tgz",
...@@ -7653,9 +7667,9 @@ ...@@ -7653,9 +7667,9 @@
} }
}, },
"rc-util": { "rc-util": {
"version": "5.6.6", "version": "5.7.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.6.6.tgz", "resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.7.0.tgz",
"integrity": "sha1-YmMqirMdzEdNKO/5qlw/8kBeEUY=", "integrity": "sha1-d2sUz1u/wk9Bn9QMQv+t3doHGPw=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.12.5", "@babel/runtime": "^7.12.5",
...@@ -11395,9 +11409,9 @@ ...@@ -11395,9 +11409,9 @@
"dev": true "dev": true
}, },
"dayjs": { "dayjs": {
"version": "1.10.3", "version": "1.10.4",
"resolved": "https://g.civnet.cn:4873/dayjs/-/dayjs-1.10.3.tgz", "resolved": "https://g.civnet.cn:4873/dayjs/-/dayjs-1.10.4.tgz",
"integrity": "sha1-zzNXyOf1CEMoJjcWcuvzdst9YZs=", "integrity": "sha1-jlRKm4aD9heD9XCYCoqA6vVKseI=",
"dev": true "dev": true
}, },
"debug": { "debug": {
...@@ -18793,9 +18807,9 @@ ...@@ -18793,9 +18807,9 @@
"dev": true "dev": true
}, },
"kit_global_config": { "kit_global_config": {
"version": "1.0.22", "version": "1.0.23",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.22.tgz", "resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.23.tgz",
"integrity": "sha512-L/JsC2eL5pRGociJ1ZT3gZK5mJbR28uh9h5drgNcBJK313GcRQSFMzk5AAif14LGwbIBM1zi7k8uUQXseDAsyg==", "integrity": "sha512-KxSOSm+57mkL40ps28ybz+btXSC9zAWdOGIrG3z0H1V17ZzENMWlTbLGqzHXtFGXXa5QNhJuijJ6DNi214dymw==",
"requires": { "requires": {
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"js-base64": "^3.5.2", "js-base64": "^3.5.2",
...@@ -24960,14 +24974,27 @@ ...@@ -24960,14 +24974,27 @@
} }
}, },
"rc-drawer": { "rc-drawer": {
"version": "4.2.0", "version": "4.2.2",
"resolved": "https://g.civnet.cn:4873/rc-drawer/-/rc-drawer-4.2.0.tgz", "resolved": "https://g.civnet.cn:4873/rc-drawer/-/rc-drawer-4.2.2.tgz",
"integrity": "sha1-AqYrXwF3/URf+2QZFn4vZ8yegvM=", "integrity": "sha1-X9ixjOIFdf8is24MXdvjY8E9tVU=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"rc-util": "^5.6.2" "rc-util": "^5.7.0"
},
"dependencies": {
"rc-util": {
"version": "5.7.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.7.0.tgz",
"integrity": "sha1-d2sUz1u/wk9Bn9QMQv+t3doHGPw=",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"react-is": "^16.12.0",
"shallowequal": "^1.1.0"
}
}
} }
}, },
"rc-dropdown": { "rc-dropdown": {
...@@ -24982,9 +25009,9 @@ ...@@ -24982,9 +25009,9 @@
} }
}, },
"rc-field-form": { "rc-field-form": {
"version": "1.17.3", "version": "1.18.1",
"resolved": "https://g.civnet.cn:4873/rc-field-form/-/rc-field-form-1.17.3.tgz", "resolved": "https://g.civnet.cn:4873/rc-field-form/-/rc-field-form-1.18.1.tgz",
"integrity": "sha1-WT0xxRBx1Pa6QNc7n4AYhIIwV3w=", "integrity": "sha1-QQJ4FsgNGs9vUdsIXTTCw1ITpwE=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.8.4", "@babel/runtime": "^7.8.4",
...@@ -24993,21 +25020,21 @@ ...@@ -24993,21 +25020,21 @@
} }
}, },
"rc-image": { "rc-image": {
"version": "5.0.2", "version": "5.1.4",
"resolved": "https://g.civnet.cn:4873/rc-image/-/rc-image-5.0.2.tgz", "resolved": "https://g.civnet.cn:4873/rc-image/-/rc-image-5.1.4.tgz",
"integrity": "sha1-WwCzIB70u5748Ypv/mByQBHzy6M=", "integrity": "sha1-4lEQEVnbgMPjMnaqpGaamRx0hsA=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"rc-dialog": "~8.5.1", "rc-dialog": "~8.5.0",
"rc-util": "^5.0.6" "rc-util": "^5.0.6"
} }
}, },
"rc-input-number": { "rc-input-number": {
"version": "6.1.2", "version": "6.1.3",
"resolved": "https://g.civnet.cn:4873/rc-input-number/-/rc-input-number-6.1.2.tgz", "resolved": "https://g.civnet.cn:4873/rc-input-number/-/rc-input-number-6.1.3.tgz",
"integrity": "sha1-ZmPtoK5rdeRk5j3zddKTCM67Dtg=", "integrity": "sha1-1Vi+ZXk0KYB8ws3DYK9AdZnYAoM=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
...@@ -25016,9 +25043,9 @@ ...@@ -25016,9 +25043,9 @@
} }
}, },
"rc-mentions": { "rc-mentions": {
"version": "1.5.2", "version": "1.5.3",
"resolved": "https://g.civnet.cn:4873/rc-mentions/-/rc-mentions-1.5.2.tgz", "resolved": "https://g.civnet.cn:4873/rc-mentions/-/rc-mentions-1.5.3.tgz",
"integrity": "sha512-GqV0tOtHY3pLpOsFCxJ2i6Ad8AVfxFmz0NlD/8rb8IG8pMpthJKcdfnXlNZRx3Fa9O4YEgJpdSY1WEbmlx2DWQ==", "integrity": "sha1-uSvrrfitn7NYa6Gvki1jtJ2ZHGc=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
...@@ -25030,20 +25057,32 @@ ...@@ -25030,20 +25057,32 @@
} }
}, },
"rc-menu": { "rc-menu": {
"version": "8.10.1", "version": "8.10.5",
"resolved": "https://g.civnet.cn:4873/rc-menu/-/rc-menu-8.10.1.tgz", "resolved": "https://g.civnet.cn:4873/rc-menu/-/rc-menu-8.10.5.tgz",
"integrity": "sha1-VjfYV2Dqa9bq1J9ErilobFzFl5g=", "integrity": "sha1-RLc4HGUMx2Ag39ZXU7U19BUBIXk=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
"classnames": "2.x", "classnames": "2.x",
"mini-store": "^3.0.1", "mini-store": "^3.0.1",
"omit.js": "^2.0.0",
"rc-motion": "^2.0.1", "rc-motion": "^2.0.1",
"rc-trigger": "^5.1.2", "rc-trigger": "^5.1.2",
"rc-util": "^5.5.0", "rc-util": "^5.7.0",
"resize-observer-polyfill": "^1.5.0", "resize-observer-polyfill": "^1.5.0",
"shallowequal": "^1.1.0" "shallowequal": "^1.1.0"
},
"dependencies": {
"rc-util": {
"version": "5.7.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.7.0.tgz",
"integrity": "sha1-d2sUz1u/wk9Bn9QMQv+t3doHGPw=",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"react-is": "^16.12.0",
"shallowequal": "^1.1.0"
}
}
} }
}, },
"rc-motion": { "rc-motion": {
...@@ -25155,9 +25194,9 @@ ...@@ -25155,9 +25194,9 @@
} }
}, },
"rc-select": { "rc-select": {
"version": "12.1.0", "version": "12.1.2",
"resolved": "https://g.civnet.cn:4873/rc-select/-/rc-select-12.1.0.tgz", "resolved": "https://g.civnet.cn:4873/rc-select/-/rc-select-12.1.2.tgz",
"integrity": "sha1-jaiVKOpBMscSCPlTp+deoc1Pi98=", "integrity": "sha1-f18Gg4uKjIZRastm6tJq28VfvBY=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
...@@ -25205,9 +25244,9 @@ ...@@ -25205,9 +25244,9 @@
} }
}, },
"rc-table": { "rc-table": {
"version": "7.12.3", "version": "7.12.4",
"resolved": "https://g.civnet.cn:4873/rc-table/-/rc-table-7.12.3.tgz", "resolved": "https://g.civnet.cn:4873/rc-table/-/rc-table-7.12.4.tgz",
"integrity": "sha1-yG6TtA3D4riq6eVK16paZP99Jh4=", "integrity": "sha1-vqP0UcDS0W0fypui1/eH3xiw2AY=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
...@@ -25260,15 +25299,15 @@ ...@@ -25260,15 +25299,15 @@
} }
}, },
"rc-textarea": { "rc-textarea": {
"version": "0.3.3", "version": "0.3.4",
"resolved": "https://g.civnet.cn:4873/rc-textarea/-/rc-textarea-0.3.3.tgz", "resolved": "https://g.civnet.cn:4873/rc-textarea/-/rc-textarea-0.3.4.tgz",
"integrity": "sha1-aFEBCYUIplsbp5cgze20yo/ibak=", "integrity": "sha1-FAimTIe15221yEdpnvmrXul91vk=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.10.1", "@babel/runtime": "^7.10.1",
"classnames": "^2.2.1", "classnames": "^2.2.1",
"omit.js": "^2.0.0", "rc-resize-observer": "^1.0.0",
"rc-resize-observer": "^1.0.0" "rc-util": "^5.7.0"
}, },
"dependencies": { "dependencies": {
"rc-resize-observer": { "rc-resize-observer": {
...@@ -25282,13 +25321,24 @@ ...@@ -25282,13 +25321,24 @@
"rc-util": "^5.0.0", "rc-util": "^5.0.0",
"resize-observer-polyfill": "^1.5.1" "resize-observer-polyfill": "^1.5.1"
} }
},
"rc-util": {
"version": "5.7.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.7.0.tgz",
"integrity": "sha1-d2sUz1u/wk9Bn9QMQv+t3doHGPw=",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"react-is": "^16.12.0",
"shallowequal": "^1.1.0"
}
} }
} }
}, },
"rc-tooltip": { "rc-tooltip": {
"version": "5.0.1", "version": "5.0.2",
"resolved": "https://g.civnet.cn:4873/rc-tooltip/-/rc-tooltip-5.0.1.tgz", "resolved": "https://g.civnet.cn:4873/rc-tooltip/-/rc-tooltip-5.0.2.tgz",
"integrity": "sha512-3AnxhUS0j74xAV3khrKw8o6rg+Ima3nw09DJBezMPnX3ImQUAnayWsPSlN1mEnihjA43rcFkGM1emiKE+CXyMQ==", "integrity": "sha1-5IJY/JkxvZKBECstnqzFuYbPMlg=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
...@@ -25322,9 +25372,9 @@ ...@@ -25322,9 +25372,9 @@
} }
}, },
"rc-trigger": { "rc-trigger": {
"version": "5.2.0", "version": "5.2.1",
"resolved": "https://g.civnet.cn:4873/rc-trigger/-/rc-trigger-5.2.0.tgz", "resolved": "https://g.civnet.cn:4873/rc-trigger/-/rc-trigger-5.2.1.tgz",
"integrity": "sha1-oX8aXLprj6/2LmWKXJoh+Xry7wY=", "integrity": "sha1-VGhiILiE7R4HUMTyQR+7NNSSjJk=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
...@@ -25356,9 +25406,9 @@ ...@@ -25356,9 +25406,9 @@
} }
}, },
"rc-virtual-list": { "rc-virtual-list": {
"version": "3.2.4", "version": "3.2.6",
"resolved": "https://g.civnet.cn:4873/rc-virtual-list/-/rc-virtual-list-3.2.4.tgz", "resolved": "https://g.civnet.cn:4873/rc-virtual-list/-/rc-virtual-list-3.2.6.tgz",
"integrity": "sha1-U+kY+J7doNtNj8yBB1fA2qx5KN4=", "integrity": "sha1-LJKkD0Ql4ZiBs4E01r0oahETfS0=",
"dev": true, "dev": true,
"requires": { "requires": {
"classnames": "^2.2.6", "classnames": "^2.2.6",
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"promise.prototype.finally": "^3.1.2", "promise.prototype.finally": "^3.1.2",
"@wisdom-utils/components": "0.0.6", "@wisdom-utils/components": "0.0.6",
"@wisdom-utils/utils": "0.0.29", "@wisdom-utils/utils": "0.0.30",
"@wisdom-utils/vapp-browser-vm": "^0.0.11", "@wisdom-utils/vapp-browser-vm": "^0.0.11",
"@wisdom-utils/vapp-browser-vm-plugins": "^0.0.13", "@wisdom-utils/vapp-browser-vm-plugins": "^0.0.13",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
"ip": "1.1.5", "ip": "1.1.5",
"js-base64": "^3.5.2", "js-base64": "^3.5.2",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"kit_global_config": "^1.0.22", "kit_global_config": "^1.0.23",
"kit_logger": "^1.0.2", "kit_logger": "^1.0.2",
"kit_utils": "^1.3.8", "kit_utils": "^1.3.8",
"lodash": "4.17.11", "lodash": "4.17.11",
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"multer": "^1.4.2", "multer": "^1.4.2",
"add-asset-html-webpack-plugin": "3.1.3", "add-asset-html-webpack-plugin": "3.1.3",
"antd": "^4.10.1", "antd": "^4.11.2",
"babel-core": "7.0.0-bridge.0", "babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1", "babel-eslint": "10.0.1",
"babel-loader": "8.0.5", "babel-loader": "8.0.5",
......
...@@ -66,7 +66,8 @@ const initLocale = () => { ...@@ -66,7 +66,8 @@ const initLocale = () => {
const initGlobalConfig = () => { const initGlobalConfig = () => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
let config = {}; let config = createStoreage.get('globalConfig') || {};
store.dispatch(actionCreators.updateComplexConfig({}));
if (!Cookies.get('token') || config.token == null) { if (!Cookies.get('token') || config.token == null) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
createStoreage.remove(namespace); createStoreage.remove(namespace);
...@@ -87,7 +88,8 @@ const initGlobalConfig = () => { ...@@ -87,7 +88,8 @@ const initGlobalConfig = () => {
if (config.token !== null && Object.keys(config).length > 0) { if (config.token !== null && Object.keys(config).length > 0) {
store.dispatch(actionCreators.getConfig(config)); store.dispatch(actionCreators.getConfig(config));
render({ appContent: '', loading: true }); // render({ appContent: '', loading: true });
initMicroApps(loader, store);
} else { } else {
appService.getWateWayConfig().then(res => { appService.getWateWayConfig().then(res => {
const hasGateWay = const hasGateWay =
......
...@@ -82,6 +82,7 @@ class AvatarDropdown extends React.Component { ...@@ -82,6 +82,7 @@ class AvatarDropdown extends React.Component {
debugger debugger
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0); this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
this.props.updateConfig && this.props.updateConfig({}); this.props.updateConfig && this.props.updateConfig({});
this.props.updateComplexConfig && this.props.updateComplexConfig({});
createStoreage.remove(`__PANDA_STORE__${location.hostname}`); createStoreage.remove(`__PANDA_STORE__${location.hostname}`);
this.props.history.push( this.props.history.push(
`/user/login/?client=${window.globalConfig.client}`, `/user/login/?client=${window.globalConfig.client}`,
......
...@@ -224,6 +224,9 @@ const mapDispatchToProps = dispatch => ({ ...@@ -224,6 +224,9 @@ const mapDispatchToProps = dispatch => ({
updateConfig(config) { updateConfig(config) {
dispatch(actionCreators.getConfig(config)) dispatch(actionCreators.getConfig(config))
}, },
updateComplexConfig(config) {
dispatch(actionCreators.updateComplexConfig(config))
},
}); });
export default connect( export default connect(
mapStateToProps, mapStateToProps,
......
...@@ -366,7 +366,7 @@ const BasicLayout = props => { ...@@ -366,7 +366,7 @@ const BasicLayout = props => {
props.updateComplexPathName(path); props.updateComplexPathName(path);
const findDeepLevelConfig = findPathByLeafId( const findDeepLevelConfig = findPathByLeafId(
parent.path, parent.path,
[currentRoutes], currentRoutes.routes,
'', '',
'path', 'path',
); );
...@@ -374,25 +374,40 @@ const BasicLayout = props => { ...@@ -374,25 +374,40 @@ const BasicLayout = props => {
setCollapse(true); setCollapse(true);
history.push(config.path); history.push(config.path);
} }
}, [props.location.pathname]); }, [props.location.pathname, currentRoutes]);
// useEffect(() => {
// const menu = props.menu.filter(item => !item.hideInMenu);
// if(menu.length === 0) {
// setLoading(true);
// }
// props.route && (props.route.routes.filter(item => !item.hideInMenu || item.path !== '/404' || item.path !== '/500')).length === 0 && setLoading(true);
// if(menu.length > 0 && props.route && props.route.routes.length > 0) {
// setCurrentRoutes(props.route.routes[props.currentMenuIndex]);
// setLoading(false);
// }
// }, [props.currentMenuIndex, props.route, props.menu]);
useEffect(() => {
setLoading(true);
clearTime = setTimeout(() => (setCurrentRoutes(props.route.routes[props.currentMenuIndex]), setLoading(false)), 400);
return () => clearTimeout && clearTimeout(clearTime);
}, [props.currentMenuIndex]);
useEffect(() => { useEffect(() => {
const menu = props.menu.filter(item => !item.hideInMenu); const menu = props.menu.filter(item => !item.hideInMenu);
if(menu.length === 0) {
setLoading(true); setLoading(true);
} clearTime = setTimeout(() => {
props.route && (props.route.routes.filter(item => !item.hideInMenu || item.path !== '/404' || item.path !== '/500')).length === 0 && setLoading(true); props.route && (props.route.routes.filter(item => !item.hideInMenu || item.path !== '/404' || item.path !== '/500')).length === 0 && setLoading(true);
if(menu.length > 0 && props.route && props.route.routes.length > 0) { if(menu.length > 0 && props.route && props.route.routes.length > 0) {
setCurrentRoutes(props.route.routes[props.currentMenuIndex]); setCurrentRoutes(props.route.routes[props.currentMenuIndex]);
setLoading(false); setLoading(false);
} }
}, [props.route, props.menu]); }, 400);
useEffect(() => {
setLoading(true);
clearTime = setTimeout(() => (setCurrentRoutes(props.route.routes[props.currentMenuIndex]), setLoading(false)), 400);
return () => clearTimeout && clearTimeout(clearTime); return () => clearTimeout && clearTimeout(clearTime);
}, [props.currentMenuIndex]) }, [props.menu]);
useEffect(() => { useEffect(() => {
siteAction.setGlobalConfig(props.global); siteAction.setGlobalConfig(props.global);
...@@ -453,7 +468,7 @@ const BasicLayout = props => { ...@@ -453,7 +468,7 @@ const BasicLayout = props => {
); );
}, [location.pathname]); }, [location.pathname]);
const handleSelectedKey = item => { const handleSelectedKey = item => {
const config = findPathByLeafId(item.path, [currentRoutes], '', 'path'); const config = findPathByLeafId(item.path, currentRoutes.routes, '', 'path');
props.updateComplexConfig({}); props.updateComplexConfig({});
props.updateComplexPathName(null); props.updateComplexPathName(null);
if (config && config.routes && config.routes.length > 0) { if (config && config.routes && config.routes.length > 0) {
...@@ -744,10 +759,11 @@ const BasicLayout = props => { ...@@ -744,10 +759,11 @@ const BasicLayout = props => {
)} )}
openKeys={[...openKeys]} openKeys={[...openKeys]}
menuProps={{ menuProps={{
forceSubMenuRender: false,
onClick: ({ item, key, keyPath, domEvent }) => { onClick: ({ item, key, keyPath, domEvent }) => {
domEvent.persist(); domEvent.persist();
const keyField = key.indexOf('/') > -1 ? 'path' : 'key'; const keyField = key.indexOf('/') > -1 ? 'path' : 'key';
const config = findPathByLeafId(key, [currentRoutes], '', keyField); const config = findPathByLeafId(key, currentRoutes.routes, '', keyField);
props.updateComplexConfig({}); props.updateComplexConfig({});
props.updateComplexPathName(null); props.updateComplexPathName(null);
if (config && config.routes && config.routes.length > 0) { if (config && config.routes && config.routes.length > 0) {
......
...@@ -68,7 +68,6 @@ class Site { ...@@ -68,7 +68,6 @@ class Site {
ignoreSite: true, ignoreSite: true,
}) })
.then(res => { .then(res => {
debugger
if (res && res.say.errMsg === '' && res.say.statusCode === ERR_OK) { if (res && res.say.errMsg === '' && res.say.statusCode === ERR_OK) {
const result = res.getMe; const result = res.getMe;
let city = self.weatherCity; let city = self.weatherCity;
...@@ -347,6 +346,8 @@ class Site { ...@@ -347,6 +346,8 @@ class Site {
self.getCityStationsForUser().then(res => { self.getCityStationsForUser().then(res => {
window.share.event.emit('updateSite', res); window.share.event.emit('updateSite', res);
}); });
self.props && self.props.updateComplexConfig && self.props.updateComplexConfig({});
// window.location.reload(); // window.location.reload();
window.share.event.emit('triggerMicro', this.props.global); window.share.event.emit('triggerMicro', this.props.global);
}); });
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
.@{ant-prefix}-menu-inline-collapsed .@{ant-prefix}-menu-inline-collapsed
.@{ant-prefix}-menu-item-only-child.@{ant-prefix}-menu-item-selected) { .@{ant-prefix}-menu-item-only-child.@{ant-prefix}-menu-item-selected) {
border-left: 2px solid @primary-color; border-left: 2px solid @primary-color;
background-color: @menu-dark-submenu-bg!important; background-color: @menu-dark-inline-submenu-bg!important;
transition: cubic-bezier(0.175, 0.885, 0.32, 1.275); transition: cubic-bezier(0.175, 0.885, 0.32, 1.275);
} }
:global(.@{ant-prefix}-menu-submenu-popup :global(.@{ant-prefix}-menu-submenu-popup
......
...@@ -53,12 +53,13 @@ export const initMicroApps = (loader, store) => { ...@@ -53,12 +53,13 @@ export const initMicroApps = (loader, store) => {
], ],
beforeMount: [ beforeMount: [
app => { app => {
debugger
store.dispatch(actionCreators.updateMicroMounted(false));
Logger.info(`[LifeCycle] before mount %c%s ${app.name}`); Logger.info(`[LifeCycle] before mount %c%s ${app.name}`);
}, },
], ],
afterMount: [ afterMount: [
app => { app => {
store.dispatch(actionCreators.updateMicroMounted(false));
Logger.info(`[LifeCycle] after mount %c%s ${app.name}`); Logger.info(`[LifeCycle] after mount %c%s ${app.name}`);
}, },
], ],
...@@ -145,8 +146,10 @@ export const defaultApp = () => { ...@@ -145,8 +146,10 @@ export const defaultApp = () => {
config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage)
? 'civweb4' ? 'civweb4'
: 'civweb4'; : 'civweb4';
setDefaultMountApp( const defaultURL =
`/${pkg.name.toLocaleLowerCase()}/${basePath}?client=${config.client}`, config.homepage === ''
); ? `/${pkg.name.toLocaleLowerCase()}/${basePath}?client=${config.client}`
: `${basePath}/${config.homepage}`;
setDefaultMountApp(defaultURL);
} }
}; };
...@@ -64,6 +64,7 @@ const BootPage = props => { ...@@ -64,6 +64,7 @@ const BootPage = props => {
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global); window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0); props.updateCurrentIndex(0);
window.location.reload();
}); });
}, []); }, []);
useEffect(() => { useEffect(() => {
......
...@@ -661,6 +661,7 @@ class Login { ...@@ -661,6 +661,7 @@ class Login {
self.globalConfig.token = token; self.globalConfig.token = token;
if(response.access_token!== "") { if(response.access_token!== "") {
self.globalConfig.access_token = response.access_token; self.globalConfig.access_token = response.access_token;
localStorage.setItem('access_token', response.access_token);
} }
if (isRememberPWD) { if (isRememberPWD) {
Cookies.set(self.globalConfig.client, token, { Cookies.set(self.globalConfig.client, token, {
......
...@@ -52,6 +52,7 @@ export function getBaseName() { ...@@ -52,6 +52,7 @@ export function getBaseName() {
} }
const cache = {}; const cache = {};
export function findPathByLeafId(leafId, nodes, path, key) { export function findPathByLeafId(leafId, nodes, path, key) {
debugger
if (path === undefined) { if (path === undefined) {
path = {}; path = {};
} }
......
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