|
|
@@ -24,6 +24,7 @@
|
|
|
|
|
|
<script>
|
|
|
import VuePictureCropper, { cropper } from 'vue-picture-cropper';
|
|
|
+import http from '../plugins/http';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -59,13 +60,20 @@ export default {
|
|
|
this.result.dataURL = base64;
|
|
|
this.result.blobURL = URL.createObjectURL(blob);
|
|
|
console.log(this.result);
|
|
|
- this.updateFile({ file: file }, file.type).then(img => {
|
|
|
+ this.updateFile(base64).then(img => {
|
|
|
this.$toast.clear();
|
|
|
this.show = false;
|
|
|
this.$emit('updateImg', img);
|
|
|
});
|
|
|
// 隐藏裁切弹窗
|
|
|
// this.isShowDialog = false;
|
|
|
+ },
|
|
|
+ updateFile(base64) {
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('base64', base64);
|
|
|
+ return http.axios.post('/upload/base64', formData).then(res => {
|
|
|
+ return Promise.resolve(res.data);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
components: {
|