From 41dab4a662fc7eff52dd0e0ae8691d8118465c11 Mon Sep 17 00:00:00 2001 From: 188633308 <188633308@qq.com> Date: Sun, 25 Apr 2021 17:02:45 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=B0=E5=A2=9E=E4=BA=86=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E9=9D=99=E6=80=81=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/util/global/index.js | 1 + Web/src/views/main/index.vue | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Web/src/util/global/index.js 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(); }, }, };