fix: fix some bug
This commit is contained in:
parent
ef1832775a
commit
35045bb543
@ -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(() => {
|
||||
|
@ -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({
|
||||
|
Loading…
x
Reference in New Issue
Block a user