From 1d5c83e7e8c93b8fc0ec1430c01a69431b0af83a Mon Sep 17 00:00:00 2001 From: smallchill Date: Sat, 8 Aug 2020 15:15:56 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/topmenu.js | 2 +- src/views/system/topmenu.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/api/system/topmenu.js b/src/api/system/topmenu.js index 4b280a3..cf37482 100644 --- a/src/api/system/topmenu.js +++ b/src/api/system/topmenu.js @@ -69,7 +69,7 @@ export const grant = (topMenuIds, menuIds) => { return request({ url: '/api/blade-system/topmenu/grant', method: 'post', - params: { + data: { topMenuIds, menuIds, } diff --git a/src/views/system/topmenu.vue b/src/views/system/topmenu.vue index 94fe60b..4e49b06 100644 --- a/src/views/system/topmenu.vue +++ b/src/views/system/topmenu.vue @@ -168,12 +168,19 @@ ids.push(ele.id); }); return ids.join(","); + }, + idsArray() { + let ids = []; + this.selectionList.forEach(ele => { + ids.push(ele.id); + }); + return ids; } }, methods: { submit() { - const menuList = this.$refs.treeMenu.getCheckedKeys().join(","); - grant(this.ids, menuList).then(() => { + const menuList = this.$refs.treeMenu.getCheckedKeys(); + grant(this.idsArray, menuList).then(() => { this.box = false; this.$message({ type: "success",