|
@@ -55,7 +55,7 @@
|
|
|
<script>
|
|
|
import store from "@/store";
|
|
|
import { VueCropper } from "vue-cropper";
|
|
|
-import { uploadAvatar } from "@/api/system/user";
|
|
|
+import { uploadAvatar,upload } from "@/api/system/user";
|
|
|
|
|
|
export default {
|
|
|
components: { VueCropper },
|
|
@@ -122,6 +122,16 @@ export default {
|
|
|
// 上传图片
|
|
|
uploadImg() {
|
|
|
this.$refs.cropper.getCropBlob(data => {
|
|
|
+ // let formData = new FormData();
|
|
|
+ // formData.append("file", data);
|
|
|
+ // upload(formData).then(response => {
|
|
|
+ // this.open = false;
|
|
|
+ // this.options.img = response.url;
|
|
|
+ // store.commit('SET_AVATAR', this.options.img);
|
|
|
+ // this.$modal.msgSuccess("修改成功");
|
|
|
+ // this.visible = false;
|
|
|
+
|
|
|
+ // });
|
|
|
let formData = new FormData();
|
|
|
formData.append("avatarfile", data);
|
|
|
uploadAvatar(formData).then(response => {
|