Browse Source

限制多次重复请求

gangyj 2 years ago
parent
commit
f099125c6d
1 changed files with 11 additions and 4 deletions
  1. 11 4
      src/views/system/user.vue

+ 11 - 4
src/views/system/user.vue

@@ -1146,11 +1146,18 @@ export default {
       }
     },
     async removeUserProjectInfoAndRoleById (id) {//参建项目删除一条项目
-      const { data: res } = await removeUserProjectInfoAndRoleById({ id })
-      console.log(res);
-      if (res.code == 200) {
-        await this.findProjectAndContractList(this.fromss.userId)
+      this.deletexiangmu = true
+      try {
+        const { data: res } = await removeUserProjectInfoAndRoleById({ id })
+        console.log(res);
+        if (res.code == 200) {
+          await this.findProjectAndContractList(this.fromss.userId)
+        }
+        this.deletexiangmu = false
+      } catch (error) {
+        this.deletexiangmu = false
       }
+      
     },
     async beforeClose (done) {//弹框关闭事件
       this.fromss = {