fix: fix some bug

This commit is contained in:
Wzp-2008 2023-12-03 22:19:53 +08:00
parent ef1832775a
commit 35045bb543
2 changed files with 8 additions and 4 deletions

View File

@ -618,11 +618,15 @@ const handleUpload = (options: UploadRequestOptions): XMLHttpRequest | Promise<u
let promise = upload(options, abortController);
promise.then((response: AxiosResponse<Result<File>>) => {
if (response.data.status == 200){
options.onSuccess(response);
}else if(response.data.status == 401){
return;
}
if(response.data.status == 401){
ElMessage.error("文件:" + options.file.name + "上传失败,文件已存在!");
options.onError(new UploadAjaxError("文件已存在", 401, option.method, options.action));
return;
}
ElMessage.error("文件:" + options.file.name + "上传失败," + response.data.message);
options.onError(new UploadAjaxError(response.data.message, response.data.status, option.method, options.action));
}).catch((error) => {
options.onError(error)
}).finally(() => {

View File

@ -11,10 +11,10 @@ export default defineConfig({
server: {
host: "0.0.0.0",
port: 5173,
https: {
/* https: {
key: readFileSync("keys/agent2-key.pem"),
cert: readFileSync("keys/agent2-cert.pem"),
}
}*/
},
plugins: [
AutoImport({