|
|
@@ -294,7 +294,7 @@
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.needLogin()
|
|
|
+ // this.needLogin()
|
|
|
var sale_id = this.$route.query.id ? this.$route.query.id : 0;
|
|
|
this._getConsultCate()
|
|
|
if (sale_id!=0) {
|
|
|
@@ -320,11 +320,13 @@
|
|
|
console.log("裁剪",data)
|
|
|
let formData = new FormData();
|
|
|
formData.append("file", data);
|
|
|
- this.$axios.$post('/upload_image', formData,{'emulateJSON':true,'Content-type':'multipart/form-data'}).then(res => {
|
|
|
- if (res.status === 1) {
|
|
|
- this.dialogVisible = false
|
|
|
- this.saleInfo.img_icon=filename;
|
|
|
+ this.$axios.$post('/upload_image', formData,{
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "multipart/form-data"
|
|
|
}
|
|
|
+ }).then(res => {
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.saleInfo.img_icon=res.filename;
|
|
|
}).catch(err => {
|
|
|
|
|
|
})
|
|
|
@@ -414,11 +416,6 @@
|
|
|
if(type==1)
|
|
|
{
|
|
|
let filename=res.filename;
|
|
|
- const isLt5M = file.size / 1024 / 1024 < 5
|
|
|
- if (!isLt5M) {
|
|
|
- this.$message.error('上传文件大小不能超过 5MB!')
|
|
|
- return false
|
|
|
- }
|
|
|
// 上传成功后将图片地址赋值给裁剪框显示图片
|
|
|
this.$nextTick(() => {
|
|
|
this.option.img =filename
|