diff --git a/src/api/system/role.js b/src/api/system/role.js index a0449e6..861a346 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -22,7 +22,7 @@ export const grant = (roleIds, menuIds, dataScopeIds, apiScopeIds) => { return request({ url: '/api/blade-system/role/grant', method: 'post', - params: { + data: { roleIds, menuIds, dataScopeIds, diff --git a/src/views/authority/role.vue b/src/views/authority/role.vue index ae434e7..1bda544 100644 --- a/src/views/authority/role.vue +++ b/src/views/authority/role.vue @@ -209,16 +209,24 @@ let ids = []; this.selectionList.forEach(ele => { 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(","); - const dataScopeList = this.$refs.treeDataScope.getCheckedKeys().join(","); - const apiScopeList = this.$refs.treeApiScope.getCheckedKeys().join(","); - grant(this.ids, menuList, dataScopeList, apiScopeList).then(() => { + const menuList = this.$refs.treeMenu.getCheckedKeys(); + const dataScopeList = this.$refs.treeDataScope.getCheckedKeys(); + const apiScopeList = this.$refs.treeApiScope.getCheckedKeys(); + grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => { this.box = false; this.$message({ type: "success",