From 28a8780b444d1dfd971872442d3a0baf32235479 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期二, 01 七月 2025 13:40:56 +0800 Subject: [PATCH] 头像没展示出来 --- src/views/system/user/profile/userAvatar.vue | 30 +++++++++--------------------- 1 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue index ae36e39..ff1c9ef 100644 --- a/src/views/system/user/profile/userAvatar.vue +++ b/src/views/system/user/profile/userAvatar.vue @@ -4,18 +4,9 @@ <el-dialog :title="title" v-model="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog"> <el-row> <el-col :xs="24" :md="12" :style="{ height: '350px' }"> - <vue-cropper - ref="cropper" - :img="options.img" - :info="true" - :autoCrop="options.autoCrop" - :autoCropWidth="options.autoCropWidth" - :autoCropHeight="options.autoCropHeight" - :fixedBox="options.fixedBox" - :outputType="options.outputType" - @realTime="realTime" - v-if="visible" - /> + <vue-cropper ref="cropper" :img="options.img" :info="true" :autoCrop="options.autoCrop" + :autoCropWidth="options.autoCropWidth" :autoCropHeight="options.autoCropHeight" :fixedBox="options.fixedBox" + :outputType="options.outputType" @realTime="realTime" v-if="visible" /> </el-col> <el-col :xs="24" :md="12" :style="{ height: '350px' }"> <div class="avatar-upload-preview"> @@ -26,15 +17,12 @@ <br /> <el-row> <el-col :lg="2" :md="2"> - <el-upload - action="#" - :http-request="requestUpload" - :show-file-list="false" - :before-upload="beforeUpload" - > + <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload"> <el-button> 閫夋嫨 - <el-icon class="el-icon--right"><Upload /></el-icon> + <el-icon class="el-icon--right"> + <Upload /> + </el-icon> </el-button> </el-upload> </el-col> @@ -94,7 +82,7 @@ } /** 瑕嗙洊榛樿涓婁紶琛屼负 */ -function requestUpload() {} +function requestUpload() { } /** 鍚戝乏鏃嬭浆 */ function rotateLeft() { @@ -133,7 +121,7 @@ formData.append("avatarfile", data, options.filename) uploadAvatar(formData).then(response => { open.value = false - options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl + options.img = import.meta.env.VITE_APP_BASE_API + '/profile/' + response.imgUrl userStore.avatar = options.img proxy.$modal.msgSuccess("淇敼鎴愬姛") visible.value = false -- Gitblit v1.9.3