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 (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: "服务器连接失败,请稍后重试",

View File

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

View File

@ -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) {

View File

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

View File

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

View File

@ -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 {

View File

@ -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);