xiatian 4 yıl önce
ebeveyn
işleme
57b7243ab0

+ 6 - 6
src/modules/questions/views/InsertBluePaperStructure.vue

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

+ 6 - 6
src/modules/questions/views/InsertPaperStructure.vue

@@ -335,7 +335,7 @@ export default {
       console.log(this.paperStructId);
       if (this.paperStructId != "add") {
         //假如没ID就是新增
-        this.$http
+        this.$httpWithMsg
           .put(url, this.paperStruct)
           .then(() => {
             this.$notify({
@@ -346,16 +346,16 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
+          .catch((e) => {
             this.$notify({
               type: "error",
-              message: "试卷结构名称重复,请重新命名",
+              message: e.data.desc,
             });
 
             this.loading = false;
           });
       } else {
-        this.$http
+        this.$httpWithMsg
           .post(url, this.paperStruct)
           .then(() => {
             this.$notify({
@@ -366,11 +366,11 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
+          .catch((e) => {
             this.loading = false;
             this.$notify({
               type: "error",
-              message: "试卷结构名称重复,请重新命名",
+              message: e.data.desc,
             });
           });
       }