|
@@ -168,16 +168,18 @@ function A1IupFile({
|
|
setFileList([...info.fileList]);
|
|
setFileList([...info.fileList]);
|
|
|
|
|
|
const { status } = info.file;
|
|
const { status } = info.file;
|
|
- if (status !== "uploading") {
|
|
|
|
- // 检查请求状态
|
|
|
|
- const response = info.file.response || {};
|
|
|
|
|
|
|
|
|
|
+ // 检查请求状态
|
|
|
|
+ const response = info.file.response || {};
|
|
|
|
+
|
|
|
|
+ if (status !== "uploading") {
|
|
if (response.code !== 0) {
|
|
if (response.code !== 0) {
|
|
|
|
+ setFileList(info.fileList.filter((v) => v.uid !== info.file.uid));
|
|
clearTimeout(timeRef.current);
|
|
clearTimeout(timeRef.current);
|
|
|
|
|
|
timeRef.current = window.setTimeout(() => {
|
|
timeRef.current = window.setTimeout(() => {
|
|
- setFileList(info.fileList.filter((v) => v.uid !== info.file.uid));
|
|
|
|
- }, 100);
|
|
|
|
|
|
+ MessageFu.warning(response.msg);
|
|
|
|
+ }, 200);
|
|
}
|
|
}
|
|
if (response.code === 5001 || response.code === 5002) {
|
|
if (response.code === 5001 || response.code === 5002) {
|
|
message.warning("登录失效!");
|
|
message.warning("登录失效!");
|
|
@@ -187,7 +189,7 @@ function A1IupFile({
|
|
|
|
|
|
// console.log(info.file, info.fileList);
|
|
// console.log(info.file, info.fileList);
|
|
}
|
|
}
|
|
- if (status === "done") {
|
|
|
|
|
|
+ if (status === "done" && response.code === 0) {
|
|
// console.log("-----", info);
|
|
// console.log("-----", info);
|
|
setFileList(
|
|
setFileList(
|
|
info.fileList.map((v) => ({
|
|
info.fileList.map((v) => ({
|
|
@@ -209,11 +211,7 @@ function A1IupFile({
|
|
} else if (status === "error") {
|
|
} else if (status === "error") {
|
|
message.error(`${info.file.fileName} 上传失败.`);
|
|
message.error(`${info.file.fileName} 上传失败.`);
|
|
// 去掉列表中的失败状态文件
|
|
// 去掉列表中的失败状态文件
|
|
- clearTimeout(timeRef.current);
|
|
|
|
-
|
|
|
|
- timeRef.current = window.setTimeout(() => {
|
|
|
|
- setFileList(info.fileList.filter((v) => v.uid !== info.file.uid));
|
|
|
|
- }, 100);
|
|
|
|
|
|
+ setFileList(info.fileList.filter((v) => v.uid !== info.file.uid));
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// onDrop(e) {
|
|
// onDrop(e) {
|