提交 c47965c7 编写于 作者: Neuromancer255's avatar Neuromancer255

文件上传组件上传文件加载和点击文件下载调整

上级 d0e4016b
...@@ -145,10 +145,10 @@ export default class AppMobFileUpload extends Vue { ...@@ -145,10 +145,10 @@ export default class AppMobFileUpload extends Vue {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
} }
} }
Loading.show();
Axios.post(this.uploadUrl, params, config).then((response: any) => { Axios.post(this.uploadUrl, params, config).then((response: any) => {
Loading.hidden();
if (response && response.data && response.status === 200) { if (response && response.data && response.status === 200) {
Loading.hidden();
let data: any = response.data; let data: any = response.data;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
this.devFiles.push(Object.assign({}, data, { this.devFiles.push(Object.assign({}, data, {
...@@ -157,10 +157,11 @@ export default class AppMobFileUpload extends Vue { ...@@ -157,10 +157,11 @@ export default class AppMobFileUpload extends Vue {
} }
this.onSuccess(data, file, this.files); this.onSuccess(data, file, this.files);
} else { } else {
Loading.hidden();
this.onError(response, file, this.files); this.onError(response, file, this.files);
} }
}).catch((response: any) => { }).catch((response: any) => {
Loading.hidden();
this.onError(response, file, this.files); this.onError(response, file, this.files);
}); });
} }
...@@ -340,7 +341,7 @@ export default class AppMobFileUpload extends Vue { ...@@ -340,7 +341,7 @@ export default class AppMobFileUpload extends Vue {
file.url = this.devFiles[index].url; file.url = this.devFiles[index].url;
file.isImage = true; file.isImage = true;
} }
return; // return;
} }
let _downloadUrl = `${this.downloadUrl}/${file.id}`; let _downloadUrl = `${this.downloadUrl}/${file.id}`;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册