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 | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue
index f8ceef9..8e9982a 100644
--- a/src/views/system/user/profile/userAvatar.vue
+++ b/src/views/system/user/profile/userAvatar.vue
@@ -25,26 +25,26 @@
<el-row>
<el-col :lg="2" :md="2">
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
- <el-button size="small">
+ <el-button>
閫夋嫨
<el-icon class="el-icon--right"><Upload /></el-icon>
</el-button>
</el-upload>
</el-col>
<el-col :lg="{span: 1, offset: 2}" :md="2">
- <el-button icon="Plus" size="small" @click="changeScale(1)"></el-button>
+ <el-button icon="Plus" @click="changeScale(1)"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
- <el-button icon="Minus" size="small" @click="changeScale(-1)"></el-button>
+ <el-button icon="Minus" @click="changeScale(-1)"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
- <el-button icon="RefreshLeft" size="small" @click="rotateLeft()"></el-button>
+ <el-button icon="RefreshLeft" @click="rotateLeft()"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
- <el-button icon="RefreshRight" size="small" @click="rotateRight()"></el-button>
+ <el-button icon="RefreshRight" @click="rotateRight()"></el-button>
</el-col>
<el-col :lg="{span: 2, offset: 6}" :md="2">
- <el-button type="primary" size="small" @click="uploadImg()">鎻� 浜�</el-button>
+ <el-button type="primary" @click="uploadImg()">鎻� 浜�</el-button>
</el-col>
</el-row>
</el-dialog>
@@ -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