From 930a0652ab5b2e34c8b3b184659f84ae82e8ce25 Mon Sep 17 00:00:00 2001 From: Ldc <ldc@vci.com> Date: 星期日, 07 四月 2024 18:14:10 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/ProjectWeb/src/store/modules/user.js | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Source/ProjectWeb/src/store/modules/user.js b/Source/ProjectWeb/src/store/modules/user.js index 1a65fee..3878f5f 100644 --- a/Source/ProjectWeb/src/store/modules/user.js +++ b/Source/ProjectWeb/src/store/modules/user.js @@ -27,10 +27,22 @@ } else { ele[propsDefault.children].forEach(child => { addPath(child); - }) - } + }); + } } + +function updateCode(items) { + items.forEach(item => { + item.pathValue = item.path; + item.path = '/' + item.code; + if (item.children && item.children.length > 0) { + updateCode(item.children); + } + }); +} + + const user = { state: { @@ -208,10 +220,12 @@ let menu = deepClone(data); menu.forEach(ele => { addPath(ele, true); + updateCode([ele]); }); + commit('SET_MENU_ALL', menu) commit('SET_MENU', menu) - //dispatch('GetButtons'); + //dispatch('GetButtons');s resolve(menu) }) }) -- Gitblit v1.9.3