diff --git a/Web/src/util/global/index.js b/Web/src/util/global/index.js new file mode 100644 index 0000000..5415709 --- /dev/null +++ b/Web/src/util/global/index.js @@ -0,0 +1 @@ +export const EMPTY_ID = '00000000-0000-0000-0000-000000000000' \ No newline at end of file diff --git a/Web/src/views/main/index.vue b/Web/src/views/main/index.vue index 6a7ff49..8a4d288 100644 --- a/Web/src/views/main/index.vue +++ b/Web/src/views/main/index.vue @@ -42,6 +42,8 @@ import Setting from './setting'; import { setGlobal } from '@/common/login'; import { APP_MENU_KEY } from '@/common/storage'; +import { EMPTY_ID } from '@/util/global'; + const getNewID = () => { return Math.random().toString(16).slice(2); }; @@ -260,9 +262,7 @@ export default { return m; }; - const rootId = '00000000-0000-0000-0000-000000000000'; - - this.nav.menus = children[rootId] ? serialize(children[rootId]) : new Array(); + this.nav.menus = children[EMPTY_ID] ? serialize(children[EMPTY_ID]) : new Array(); }, }, };