Commit 24d9b91a authored by Maofei94's avatar Maofei94

perf: perf

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