Compare commits
4 Commits
0d1a96b202
...
a68b2a2805
Author | SHA1 | Date |
---|---|---|
lyc | a68b2a2805 | |
yangws | 71fe8a0a8f | |
yangws | b8f95eb20f | |
lyc | 5328607ce1 |
|
@ -29,7 +29,7 @@
|
|||
@command="handleCommand"
|
||||
>
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="userStore.user.avatar" class="user-avatar" style="float: left" />
|
||||
<img :src="dev_api + userStore.user.avatar" class="user-avatar" style="float: left" />
|
||||
<div style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
|
@ -62,6 +62,7 @@ const { ipcRenderer } = window.electron || {}
|
|||
const userStore = useUserStore()
|
||||
const router = useRouter()
|
||||
const currentRoute = ref('')
|
||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||
|
||||
const handleOutLink = (path, type) => {
|
||||
if (!path) return
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<!-- 裁剪+效果 -->
|
||||
<div class="box">
|
||||
<div class="box_1">
|
||||
<img :src="filePath" ref="image" />
|
||||
<img :src="dev_api + filePath" ref="image" />
|
||||
</div>
|
||||
|
||||
<!--裁剪完的图片-->
|
||||
|
@ -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
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="user-info-head" @click="editCropper()">
|
||||
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
|
||||
<img :src="dev_api + options.img" title="点击上传头像" class="img-circle img-lg" />
|
||||
<el-dialog
|
||||
v-model="open"
|
||||
append-to-body
|
||||
|
@ -28,6 +28,7 @@ const userStore = useUserStore()
|
|||
|
||||
const open = ref(false)
|
||||
const visible = ref(false)
|
||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||
|
||||
//图片裁剪数据
|
||||
const options = reactive({
|
||||
|
@ -56,7 +57,7 @@ function uploadImg(data) {
|
|||
formData.append('avatarfile', data)
|
||||
uploadAvatar(formData).then((response) => {
|
||||
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: '上传成功',
|
||||
|
|
Loading…
Reference in New Issue