Commit d0db5561 authored by caicaicai's avatar caicaicai

修改

parent e885549a
......@@ -6,6 +6,16 @@ var HttpReq = function(){
return {
//卡车调度系统
truckDispatching:{
//图片上传
uploadPictures: function(data){
return request({
url: '/api/Area/updateAvatar',
method: 'POST',
data:data,
}).then((res) => {
return res
})
},
//系统管理——班次设置
shiftQuery: function(param){
return request({
......
......@@ -262,23 +262,31 @@ export default {
let file = event.target.files[0];
let formData1 = new FormData();
formData1.append("avatar", file);
Axios({
url: process.env.VUE_APP_LOCAL_API2 + '/api/Area/updateAvatar',
method: "post",
data: formData1,
}).then(
response => {
if (response.status == 200) {
this.$message.success("上传成功");
that.picFileName = response.data.avatar;
} else {
this.$message.error("上传失败");
}
},
)
.catch(error => {
console.log(error);
});
HttpReq.truckDispatching.uploadPictures(formData1).then((res) => {
this.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
});
that.picFileName = res.avatar;
})
// Axios({
// url: process.env.VUE_APP_LOCAL_API2 + '/api/users/updateAvatar',
// method: "post",
// data: formData1,
// }).then(
// response => {
// if (response.status == 200) {
// this.$message.success("上传成功");
// that.picFileName = response.data.avatar;
// } else {
// this.$message.error("上传失败");
// }
// },
// )
// .catch(error => {
// console.log(error);
// });
},
}
}
......
......@@ -480,23 +480,14 @@ export default {
let file = event.target.files[0];
let formData1 = new FormData();
formData1.append("avatar", file);
Axios({
url: process.env.VUE_APP_LOCAL_API2 + '/api/Area/updateAvatar',
method: "post",
data: formData1,
}).then(
response => {
if (response.status == 200) {
this.$message.success("上传成功");
that.picFileName = response.data.avatar;
} else {
this.$message.error("上传失败");
}
},
)
.catch(error => {
console.log(error);
});
HttpReq.truckDispatching.uploadPictures(formData1).then((res) => {
this.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
});
that.picFileName = res.avatar;
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment