Browse Source

fix🐛 修复用户删除调用接口404的问题

wenjianzhang 4 years ago
parent
commit
361550a2c8
2 changed files with 7 additions and 6 deletions
  1. 4 3
      src/api/system/sysuser.js
  2. 3 3
      src/views/sysuser/index.vue

+ 4 - 3
src/api/system/sysuser.js

@@ -43,10 +43,11 @@ export function updateUser(data) {
 }
 
 // 删除用户
-export function delUser(userId) {
+export function delUser(data) {
   return request({
-    url: '/api/v1/sysUser/' + userId,
-    method: 'delete'
+    url: '/api/v1/sysUser',
+    method: 'delete',
+    data: data
   })
 }
 

+ 3 - 3
src/views/sysuser/index.vue

@@ -617,13 +617,13 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const userIds = row.userId || this.ids
-      this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', '警告', {
+      const ids = (row.userId && [row.userId]) || this.ids
+      this.$confirm('是否确认删除用户编号为"' + ids + '"的数据项?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(function() {
-        return delUser(userIds)
+        return delUser({ 'ids': ids })
       }).then(() => {
         this.getList()
         this.msgSuccess('删除成功')