bugfix 0703反馈
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
:current-page.sync="page"
|
||||
:page-sizes="[1, 5, 10, 20, 50, 100]"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="size"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
|
||||
@@ -128,34 +128,43 @@ export default {
|
||||
},
|
||||
|
||||
handleSuccess(response, file, fileList) {
|
||||
// console.log("success response", response);
|
||||
console.log("success response", response);
|
||||
|
||||
if ("code" in response && response.code === 500) {
|
||||
try {
|
||||
if ("code" in response && response.code === 500) {
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: "error",
|
||||
duration: 1500,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let message = "";
|
||||
let isError = false;
|
||||
|
||||
if (typeof response === "object" && "msg" in response) message = response.msg;
|
||||
if (typeof response === "object" && "data" in response) message = response.data.toString();
|
||||
if (typeof response === "string") {
|
||||
message = response;
|
||||
isError = true;
|
||||
}
|
||||
|
||||
this.handleClose();
|
||||
this.$emit("uploadSuccess");
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
message,
|
||||
type: isError ? "error" : "info",
|
||||
duration: 2000,
|
||||
});
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: response,
|
||||
type: "error",
|
||||
duration: 1500,
|
||||
duration: 2500,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let message = "";
|
||||
let isError = false;
|
||||
|
||||
if (typeof response === "object" && "msg" in response) message = response.msg;
|
||||
if (typeof response === "object" && "data" in response) message = response.data.toString();
|
||||
if (typeof response === "string") {
|
||||
message = response;
|
||||
isError = true;
|
||||
}
|
||||
|
||||
this.handleClose();
|
||||
|
||||
this.$message({
|
||||
message,
|
||||
type: isError ? "error" : "info",
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
|
||||
handleError(err, file, fileList) {
|
||||
|
||||
Reference in New Issue
Block a user