diff --git a/src/utils/request.js b/src/utils/request.js index 21df101..1dec59d 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -48,14 +48,19 @@ service.interceptors.response.use( // if the custom code is not 20000, it is judged as an error. if (res.c !== 200) { - if (res.c === 500) { - // console.log(123); - Message({ - message: errorCodeMap(res.c), - type: "error", - duration: 5 * 1000 - }); - } + // if (res.c === 500) { + // // console.log(123); + // Message({ + // message: errorCodeMap(res.c), + // type: "error", + // duration: 5 * 1000 + // }); + // } + Message({ + message: errorCodeMap(res.c)||res.m, + type: "error", + duration: 5 * 1000 + }); // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; if (res.c === 403003 || res.c === 403001) { @@ -70,13 +75,13 @@ service.interceptors.response.use( }) }) } - // return Promise.reject(new Error(res.data.m || "Error")); - return Promise.reject(new Error(errorCodeMap(res.c)||"Error")) + return Promise.reject(new Error(res.m || 'Error')) } else { return res; } }, error => { + console.log('error:'+error); console.log("err" + error); // for debug Message({ message: "服务器连接失败,请稍后重试", diff --git a/src/views/convenience/add.vue b/src/views/convenience/add.vue index f26138c..754c03b 100644 --- a/src/views/convenience/add.vue +++ b/src/views/convenience/add.vue @@ -128,6 +128,8 @@ export default { if (res.c === 200) { this.$notify.success("创建成功"); this.$router.push("/convenience/list"); + }else{ + this.$notify.error(res.m) } }); } diff --git a/src/views/convenience/detail.vue b/src/views/convenience/detail.vue index 72bca90..6cf8b0a 100644 --- a/src/views/convenience/detail.vue +++ b/src/views/convenience/detail.vue @@ -1181,6 +1181,8 @@ export default { // console.log(res); if (res.c === 200) { this.$notify.success("提交成功"); + }else{ + this.$notify.error(res.m) } this.getInfo(); this.contactDialog = false; @@ -1387,7 +1389,9 @@ export default { // } // } this.getInfo(); - } + }else{ + this.$notify.error(res.m) + } }); }, isAssetTypeAnImage(ext) { diff --git a/src/views/convenience/list.vue b/src/views/convenience/list.vue index d6ff080..3858080 100644 --- a/src/views/convenience/list.vue +++ b/src/views/convenience/list.vue @@ -518,7 +518,9 @@ export default { if (res.c === 200) { this.$notify.success("操作成功"); this.getList(); - } + }else{ + this.$notify.error(res.m) + } }); }, apply() { diff --git a/src/views/helpPrint/detail.vue b/src/views/helpPrint/detail.vue index 3fc899b..22da05a 100644 --- a/src/views/helpPrint/detail.vue +++ b/src/views/helpPrint/detail.vue @@ -131,6 +131,8 @@ export default { window.open("../print.html"); this.$notify.success("添加成功"); this.$router.push("/helpPrint/list"); + }else{ + this.$notify.error(res.m) } }); } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 83a3228..ac23bd3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -321,9 +321,9 @@ export default { /* 修复input 背景不协调 和光标变色 */ /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */ -$bg: #283443; +$bg: #fff; $light_gray: #000000; -$cursor: #fff; +$cursor: #000; @supports (-webkit-mask: none) and (not (cater-color: $cursor)) { .login-container .el-input input { diff --git a/src/views/residentInformation/list.vue b/src/views/residentInformation/list.vue index b2076b6..fe7ca84 100644 --- a/src/views/residentInformation/list.vue +++ b/src/views/residentInformation/list.vue @@ -491,6 +491,8 @@ export default { this.$notify.success("创建成功"); this.dialogAddVisible = false; this.getList(); + }else{ + this.$notify.error(res.m) } }); } @@ -507,6 +509,8 @@ export default { this.$notify.success("修改成功"); this.dialogAddVisible = false; this.getList(); + }else{ + this.$notify.error(res.m) } }); } @@ -543,7 +547,9 @@ export default { this.$notify.success("删除成功"); this.dialogDeleteConfirm = false; this.getList(); - } + }else{ + this.$notify.error(res.m) + } }); }, handleIsStaff(val) { @@ -576,6 +582,7 @@ export default { this.dialogExcelImport = false; this.getList(); } else { + this.$notify.error(res.m) setTimeout(() => { this.excelUploading = false; }, 3000);