Zory hace 1 semana
padre
commit
12df29a2c7
Se han modificado 2 ficheros con 15 adiciones y 0 borrados
  1. 7 0
      src/api/model/user.js
  2. 8 0
      src/views/manage/user/components/table.vue

+ 7 - 0
src/api/model/user.js

@@ -30,4 +30,11 @@ export default {
             return await http.post(this.url, params);
         },
     },
+    del: {
+        url: `${config.API_URL}/user/del`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
 }

+ 8 - 0
src/views/manage/user/components/table.vue

@@ -86,6 +86,14 @@ export default {
         }
     },
     methods: {
+        async table_del(data){
+            var resp = await this.$API.user.del.post({"id":data.id});
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg)
+            }
+            this.$message.success(resp.msg)
+            this.$refs.table.refresh()
+        },
         async table_state(data){
             var status = 1;
             if (data.status == 1) {