-
+
@@ -60,6 +60,7 @@ export default {
},
},
setup(props, context) {
+ const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
// 原生上传的文件
const uploadImg = (e) => {
@@ -163,7 +164,7 @@ export default {
// 页面刷新自动执行
onMounted(() => {
if (props.filePath) {
- dataFile.image.src = props.filePath;
+ dataFile.image.src = dev_api.value + props.filePath;
copper();
}
});
@@ -175,6 +176,7 @@ export default {
uploadImg,
upLoading,
cancle,
+ dev_api
};
},
};
diff --git a/src/renderer/src/views/profile/userAvatar.vue b/src/renderer/src/views/profile/userAvatar.vue
index 3ddf66f..6f876fa 100644
--- a/src/renderer/src/views/profile/userAvatar.vue
+++ b/src/renderer/src/views/profile/userAvatar.vue
@@ -1,6 +1,6 @@
-
+
{
open.value = false
- options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl
+ options.img = response.imgUrl
userStore.user.avatar = options.img
ElMessage({
message: '上传成功',