From 9290e3c3185bd434e87dd2134d8830430decffa0 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 28 八月 2022 20:11:00 +0800
Subject: [PATCH] 添加新群号:160110482
---
src/views/system/user/profile/userAvatar.vue | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue
index 383d9f2..8e9982a 100644
--- a/src/views/system/user/profile/userAvatar.vue
+++ b/src/views/system/user/profile/userAvatar.vue
@@ -54,8 +54,9 @@
import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
+import useUserStore from '@/store/modules/user'
-const store = useStore();
+const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const open = ref(false);
@@ -64,7 +65,7 @@
//鍥剧墖瑁佸壀鏁版嵁
const options = reactive({
- img: store.getters.avatar, // 瑁佸壀鍥剧墖鐨勫湴鍧�
+ img: userStore.avatar, // 瑁佸壀鍥剧墖鐨勫湴鍧�
autoCrop: true, // 鏄惁榛樿鐢熸垚鎴浘妗�
autoCropWidth: 200, // 榛樿鐢熸垚鎴浘妗嗗搴�
autoCropHeight: 200, // 榛樿鐢熸垚鎴浘妗嗛珮搴�
@@ -116,7 +117,7 @@
uploadAvatar(formData).then(response => {
open.value = false;
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl;
- store.commit("SET_AVATAR", options.img);
+ userStore.avatar = options.img;
proxy.$modal.msgSuccess("淇敼鎴愬姛");
visible.value = false;
});
@@ -128,7 +129,7 @@
};
/** 鍏抽棴绐楀彛 */
function closeDialog() {
- options.img = store.getters.avatar;
+ options.img = userStore.avatar;
options.visible = false;
};
</script>
--
Gitblit v1.9.3