Browse Source

容错处理

zhuhao 1 year ago
parent
commit
4942eb570e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/views/event/components/index.vue

+ 5 - 3
src/views/event/components/index.vue

@@ -221,10 +221,14 @@ export default {
         orderDTOList:this.sort,//排序
       }
       this.$api.queryEvent(params).then(res => {
+        
         if (res.code == 200) {
           this.tableData = res.data.data
           this.total=res.data.total
         }
+      }).catch(err => {
+        this.tableData = []
+        this.total=0
       })
     },
 
@@ -316,9 +320,7 @@ export default {
         type: 'warning'
       }).then(() => {
         // 调用接口
-        let params = [
-          row.id
-        ]
+        let params = [ row.id ]
         this.$api.deleteEvent(params).then(res => {
           if (res.code == 200) {
             this.getList()