Commit bfc30da64c3e1b208b222ab01f3deefc8f4a03f2

Authored by zhangzzzz
1 parent c776144f

新增图片上传功能

src/views/bigscreenDesigner/designer/components/customUploadNew.vue
@@ -72,18 +72,18 @@ export default { @@ -72,18 +72,18 @@ export default {
72 let that = this; 72 let that = this;
73 let formdata = new FormData(); 73 let formdata = new FormData();
74 formdata.append("file", file); 74 formdata.append("file", file);
75 - // axios  
76 - // .post(this.requestUrl, formdata, {  
77 - // headers: that.headers  
78 - // })  
79 - // .then(response => {  
80 - // let res = response.data;  
81 - // if (res.code === "200") {  
82 - // that.uploadImgUrl = res.data.urlPath;  
83 - // that.$emit("input", that.uploadImgUrl);  
84 - // that.$emit("change", that.uploadImgUrl);  
85 - // }  
86 - // }); 75 + axios
  76 + .post(this.requestUrl, formdata, {
  77 + headers: that.headers
  78 + })
  79 + .then(response => {
  80 + let res = response.data;
  81 + if (res.code === "200") {
  82 + that.uploadImgUrl = res.data.urlPath;
  83 + that.$emit("input", that.uploadImgUrl);
  84 + that.$emit("change", that.uploadImgUrl);
  85 + }
  86 + });
87 }, 87 },
88 changeInput(e) { 88 changeInput(e) {
89 // if (e) { 89 // if (e) {