From c2b28e50d4abc170a55090850f4a6cdd4b06d9e7 Mon Sep 17 00:00:00 2001 From: long <515897141@qq.com> Date: 星期四, 08 四月 2021 17:39:05 +0800 Subject: [PATCH] mock模式权限不限制 --- src/layout/components/Sidebar/index.vue | 4 ++-- src/utils/g_fn.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 603476b..841b029 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -64,7 +64,7 @@ return menuData.filter((menu) => { // 浠呮湁涓�绾ц彍鍗� if (!menu.children) { - // isMock=1 鍏ㄦ樉绀� + // mock妯″紡 鍏ㄦ樉绀� if (isMock) return true // 涓嶅瓨鍦ㄦ潈闄愮殑璇濓紝榛樿鏄剧ず // console.log(menu.auth, menu.auth ? !!authData[menu.auth] : true) @@ -75,7 +75,7 @@ if (menu.children.length) { // 閫掑綊 menu.children = this.jun_filterAuth(menu.children, authData) - // isMock=1 鍏ㄦ樉绀� + // mock妯″紡 鍏ㄦ樉绀� if (isMock) return true return menu.children.length } diff --git a/src/utils/g_fn.js b/src/utils/g_fn.js index cfe0c9f..f9c1af7 100644 --- a/src/utils/g_fn.js +++ b/src/utils/g_fn.js @@ -1,3 +1,4 @@ +var isMock = require('@/config/baseConfig').isMock // 鍏ㄥ眬閰嶇疆鏂囦欢 // 鍏ㄥ眬鏂规硶 鍏ㄥ眬鏀惧ぇ 浠ュ悗缂� FN 缁撳熬 var fn = { // 閫氱敤璺宠浆 @@ -50,6 +51,8 @@ if (!key) { return 0 } + // mock妯″紡 鍏ㄦ樉绀� + if (isMock) return true return this.getAuthDataFN()[key] }, -- Gitblit v1.8.0