Jelajahi Sumber

:zap: 修复权限配置数据长度过大的bug

smallchill 6 tahun lalu
induk
melakukan
648200606a
2 mengubah file dengan 13 tambahan dan 5 penghapusan
  1. 1 1
      src/api/system/role.js
  2. 12 4
      src/views/authority/role.vue

+ 1 - 1
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,

+ 12 - 4
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",