This commit is contained in:
jiangrui 2021-05-20 09:04:51 +08:00
parent 35de06310b
commit 2c56d37d99
7 changed files with 37 additions and 15 deletions

View File

@ -48,14 +48,19 @@ service.interceptors.response.use(
// if the custom code is not 20000, it is judged as an error. // if the custom code is not 20000, it is judged as an error.
if (res.c !== 200) { if (res.c !== 200) {
if (res.c === 500) { // if (res.c === 500) {
// console.log(123); // // console.log(123);
Message({ // Message({
message: errorCodeMap(res.c), // message: errorCodeMap(res.c),
type: "error", // type: "error",
duration: 5 * 1000 // 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; // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.c === 403003 || res.c === 403001) { 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(res.m || 'Error'))
return Promise.reject(new Error(errorCodeMap(res.c)||"Error"))
} else { } else {
return res; return res;
} }
}, },
error => { error => {
console.log('error:'+error);
console.log("err" + error); // for debug console.log("err" + error); // for debug
Message({ Message({
message: "服务器连接失败,请稍后重试", message: "服务器连接失败,请稍后重试",

View File

@ -128,6 +128,8 @@ export default {
if (res.c === 200) { if (res.c === 200) {
this.$notify.success("创建成功"); this.$notify.success("创建成功");
this.$router.push("/convenience/list"); this.$router.push("/convenience/list");
}else{
this.$notify.error(res.m)
} }
}); });
} }

View File

@ -1181,6 +1181,8 @@ export default {
// console.log(res); // console.log(res);
if (res.c === 200) { if (res.c === 200) {
this.$notify.success("提交成功"); this.$notify.success("提交成功");
}else{
this.$notify.error(res.m)
} }
this.getInfo(); this.getInfo();
this.contactDialog = false; this.contactDialog = false;
@ -1387,7 +1389,9 @@ export default {
// } // }
// } // }
this.getInfo(); this.getInfo();
} }else{
this.$notify.error(res.m)
}
}); });
}, },
isAssetTypeAnImage(ext) { isAssetTypeAnImage(ext) {

View File

@ -518,7 +518,9 @@ export default {
if (res.c === 200) { if (res.c === 200) {
this.$notify.success("操作成功"); this.$notify.success("操作成功");
this.getList(); this.getList();
} }else{
this.$notify.error(res.m)
}
}); });
}, },
apply() { apply() {

View File

@ -131,6 +131,8 @@ export default {
window.open("../print.html"); window.open("../print.html");
this.$notify.success("添加成功"); this.$notify.success("添加成功");
this.$router.push("/helpPrint/list"); this.$router.push("/helpPrint/list");
}else{
this.$notify.error(res.m)
} }
}); });
} }

View File

@ -321,9 +321,9 @@ export default {
/* 修复input 背景不协调 和光标变色 */ /* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */ /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg: #283443; $bg: #fff;
$light_gray: #000000; $light_gray: #000000;
$cursor: #fff; $cursor: #000;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) { @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input { .login-container .el-input input {

View File

@ -491,6 +491,8 @@ export default {
this.$notify.success("创建成功"); this.$notify.success("创建成功");
this.dialogAddVisible = false; this.dialogAddVisible = false;
this.getList(); this.getList();
}else{
this.$notify.error(res.m)
} }
}); });
} }
@ -507,6 +509,8 @@ export default {
this.$notify.success("修改成功"); this.$notify.success("修改成功");
this.dialogAddVisible = false; this.dialogAddVisible = false;
this.getList(); this.getList();
}else{
this.$notify.error(res.m)
} }
}); });
} }
@ -543,7 +547,9 @@ export default {
this.$notify.success("删除成功"); this.$notify.success("删除成功");
this.dialogDeleteConfirm = false; this.dialogDeleteConfirm = false;
this.getList(); this.getList();
} }else{
this.$notify.error(res.m)
}
}); });
}, },
handleIsStaff(val) { handleIsStaff(val) {
@ -576,6 +582,7 @@ export default {
this.dialogExcelImport = false; this.dialogExcelImport = false;
this.getList(); this.getList();
} else { } else {
this.$notify.error(res.m)
setTimeout(() => { setTimeout(() => {
this.excelUploading = false; this.excelUploading = false;
}, 3000); }, 3000);