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",