|
@@ -31,14 +31,14 @@ const actions = {
|
|
|
async utilMethod({ commit }, payload) {
|
|
|
const res = await this.$axios.$post(`${api.util}`, payload);
|
|
|
},
|
|
|
- async taskupload({ commit }, payload) {
|
|
|
+ async taskupload({ commit }, { file, uri }) {
|
|
|
// const res = await this.$axios.$post(`${api.taskupload}`, payload, null, { 'Content-Type': 'multipart/form-data' });
|
|
|
let param = new FormData(); //创建form对象
|
|
|
- param.append('file', payload); //通过append向form对象添加数据
|
|
|
+ param.append('file', file); //通过append向form对象添加数据
|
|
|
const config = {
|
|
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
|
};
|
|
|
- const res = await axios.post(`${api.taskupload}`, param, config);
|
|
|
+ const res = await axios.post(`${uri}`, param, config);
|
|
|
return res;
|
|
|
},
|
|
|
};
|