提交 212eeb04 编写于 作者: zcdtk's avatar zcdtk

图片上传

上级 28ddd16e
...@@ -30,6 +30,7 @@ import { Environment } from '@/environments/environment'; ...@@ -30,6 +30,7 @@ import { Environment } from '@/environments/environment';
import { Subject, Unsubscribable } from 'rxjs'; import { Subject, Unsubscribable } from 'rxjs';
import Axios from 'axios'; import Axios from 'axios';
import qs from 'qs'; import qs from 'qs';
import { Loading } from '@/ibiz-core/utils';
import { Uploader } from 'vant'; import { Uploader } from 'vant';
...@@ -143,7 +144,9 @@ export default class AppMobFileUpload extends Vue { ...@@ -143,7 +144,9 @@ 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) {
let data: any = response.data; let data: any = response.data;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
...@@ -156,6 +159,7 @@ export default class AppMobFileUpload extends Vue { ...@@ -156,6 +159,7 @@ export default class AppMobFileUpload extends Vue {
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);
}); });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册