Commit 7c5e4831 authored by chenshouchao's avatar chenshouchao

feat:移动失败后的loading优化

parent 635d2b4a
...@@ -147,6 +147,16 @@ const MoveFile = (props: any) => { ...@@ -147,6 +147,16 @@ const MoveFile = (props: any) => {
refresh(); refresh();
}; };
// 移动失败后的操作
const erroeMove = (error: any) => {
if (error?.response?.status === 405) {
Message.error("因目标路径存在同名文件,数据移动失败。");
} else {
Message.error("文件服务发生错误,数据移动失败。");
}
setMoveFileSubmitloading(false);
};
// 移动 // 移动
const handleMoveFileSubmit = () => { const handleMoveFileSubmit = () => {
if (!newPath) { if (!newPath) {
...@@ -235,11 +245,7 @@ const MoveFile = (props: any) => { ...@@ -235,11 +245,7 @@ const MoveFile = (props: any) => {
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
if (error?.response?.status === 405) { erroeMove(error);
Message.error("因目标路径存在同名文件,数据移动失败。");
} else {
Message.error("文件服务发生错误,数据移动失败。");
}
}); });
}; };
...@@ -262,11 +268,7 @@ const MoveFile = (props: any) => { ...@@ -262,11 +268,7 @@ const MoveFile = (props: any) => {
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
if (error?.response?.status === 405) { erroeMove(error);
Message.error("因目标路径存在同名文件,数据移动失败。");
} else {
Message.error("文件服务发生错误,数据移动失败。");
}
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment