xiatian 2 年之前
父節點
當前提交
1416193e29
共有 1 個文件被更改,包括 4 次插入12 次删除
  1. 4 12
      src/modules/questions/views/InsertBluePaperStructure.vue

+ 4 - 12
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -443,7 +443,7 @@ export default {
       var url = QUESTION_API + "/paperStruct";
       if (this.paperStructId != "add") {
         //假如没ID就是新增
-        this.$http
+        this.$httpWithMsg
           .put(url, this.blueStruct)
           .then(() => {
             this.$notify({
@@ -454,15 +454,11 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
-            this.$notify({
-              type: "error",
-              message: "试卷结构名称重复,请重新命名",
-            });
+          .finally(() => {
             this.loading = false;
           });
       } else {
-        this.$http
+        this.$httpWithMsg
           .post(url, this.blueStruct)
           .then(() => {
             this.$notify({
@@ -473,12 +469,8 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
+          .finally(() => {
             this.loading = false;
-            this.$notify({
-              type: "error",
-              message: "试卷结构名称重复,请重新命名",
-            });
           });
       }
     },