update 新增了全局静态变量
This commit is contained in:
1
Web/src/util/global/index.js
Normal file
1
Web/src/util/global/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const EMPTY_ID = '00000000-0000-0000-0000-000000000000'
|
||||||
@@ -42,6 +42,8 @@ import Setting from './setting';
|
|||||||
import { setGlobal } from '@/common/login';
|
import { setGlobal } from '@/common/login';
|
||||||
import { APP_MENU_KEY } from '@/common/storage';
|
import { APP_MENU_KEY } from '@/common/storage';
|
||||||
|
|
||||||
|
import { EMPTY_ID } from '@/util/global';
|
||||||
|
|
||||||
const getNewID = () => {
|
const getNewID = () => {
|
||||||
return Math.random().toString(16).slice(2);
|
return Math.random().toString(16).slice(2);
|
||||||
};
|
};
|
||||||
@@ -260,9 +262,7 @@ export default {
|
|||||||
return m;
|
return m;
|
||||||
};
|
};
|
||||||
|
|
||||||
const rootId = '00000000-0000-0000-0000-000000000000';
|
this.nav.menus = children[EMPTY_ID] ? serialize(children[EMPTY_ID]) : new Array();
|
||||||
|
|
||||||
this.nav.menus = children[rootId] ? serialize(children[rootId]) : new Array();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user