Commit 24d9b91a authored by Maofei94's avatar Maofei94

perf: perf

parent cddd5c11
...@@ -10,19 +10,24 @@ import SiteConfig from './SiteConfig'; ...@@ -10,19 +10,24 @@ import SiteConfig from './SiteConfig';
import MenuConfig from './menuconfig/MenuConfig'; import MenuConfig from './menuconfig/MenuConfig';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const MobileConfigPage = props => { const MobileConfigPage = props => {
const [activeKey, setActiveKey] = useState('1'); // tabs活动页 const [activeKey, setActiveKey] = useState('0'); // tabs活动页
const [miniTitle, setMiniTitle] = useState(''); const [miniTitle, setMiniTitle] = useState('');
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
useEffect(() => { useEffect(() => {
miniAppSiteTree({ // miniAppSiteTree({
// userMode: 'admin',
// select: '',
// _version: 9999,
// _dc: new Date().getTime(),
// node: -2,
// })
getMiniAppModuleTree({
userMode: 'admin', userMode: 'admin',
select: '',
_version: 9999,
_dc: new Date().getTime(),
node: -2,
}).then(res => { }).then(res => {
if (res) { console.log(res, 'res');
const title = res[0].children[0].text || '熊猫掌天下小程序'; if (res.code === 0) {
const { data } = res;
const title = data[0].children[0].text || '熊猫掌天下小程序';
setMiniTitle(title); setMiniTitle(title);
} }
console.log(res); console.log(res);
......
...@@ -65,17 +65,22 @@ const MiniMenu = props => { ...@@ -65,17 +65,22 @@ const MiniMenu = props => {
// 更新树 // 更新树
const updateTrees = () => { const updateTrees = () => {
setLoading(true); setLoading(true);
miniAppSiteTree({ // miniAppSiteTree({
_version: 9999, // _version: 9999,
_dc: new Date().getTime(), // _dc: new Date().getTime(),
node: -2, // node: -2,
// userMode: 'super',
// select: '',
// });
getMiniAppModuleTree({
userMode: 'super', userMode: 'super',
select: '',
}) })
.then(res => { .then(res => {
if (res.length > 0) { console.log(res, 'res');
if (res.code === 0) {
const { data } = res;
setLoading(false); setLoading(false);
const result = res[0].children[0].children[2].children; const result = data[0].children[0].children[1].children;
setTreeData(result); setTreeData(result);
console.log(result); console.log(result);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
...@@ -83,6 +88,12 @@ const MiniMenu = props => { ...@@ -83,6 +88,12 @@ const MiniMenu = props => {
// handleSelect([result[0].menuID], false); // handleSelect([result[0].menuID], false);
// setTreeFlag(false); // setTreeFlag(false);
// } // }
} else {
notification({
message: '提示',
duration: 10,
description: '获取菜单失败',
});
} }
}) })
.catch(err => { .catch(err => {
......
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