Compare commits

..

4 Commits

4 changed files with 10 additions and 5 deletions

View File

@ -65,6 +65,7 @@ function createMainWindow() {
show: false, show: false,
frame: false, // 无边框 frame: false, // 无边框
autoHideMenuBar: true, autoHideMenuBar: true,
maximizable: false,
icon: join(__dirname, '../../resources/logo2.ico'), icon: join(__dirname, '../../resources/logo2.ico'),
...(process.platform === 'linux' ? { icon } : {}), ...(process.platform === 'linux' ? { icon } : {}),
webPreferences: { webPreferences: {

View File

@ -29,7 +29,7 @@
@command="handleCommand" @command="handleCommand"
> >
<div class="avatar-wrapper"> <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 style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
</div> </div>
<template #dropdown> <template #dropdown>
@ -62,6 +62,7 @@ const { ipcRenderer } = window.electron || {}
const userStore = useUserStore() const userStore = useUserStore()
const router = useRouter() const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const handleOutLink = (path, type) => { const handleOutLink = (path, type) => {
if (!path) return if (!path) return

View File

@ -11,7 +11,7 @@
<!-- 裁剪+效果 --> <!-- 裁剪+效果 -->
<div class="box"> <div class="box">
<div class="box_1"> <div class="box_1">
<img :src="filePath" ref="image" /> <img :src="dev_api + filePath" ref="image" />
</div> </div>
<!--裁剪完的图片--> <!--裁剪完的图片-->
@ -60,6 +60,7 @@ export default {
}, },
}, },
setup(props, context) { setup(props, context) {
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
// //
const uploadImg = (e) => { const uploadImg = (e) => {
@ -163,7 +164,7 @@ export default {
// //
onMounted(() => { onMounted(() => {
if (props.filePath) { if (props.filePath) {
dataFile.image.src = props.filePath; dataFile.image.src = dev_api.value + props.filePath;
copper(); copper();
} }
}); });
@ -175,6 +176,7 @@ export default {
uploadImg, uploadImg,
upLoading, upLoading,
cancle, cancle,
dev_api
}; };
}, },
}; };

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="user-info-head" @click="editCropper()"> <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 <el-dialog
v-model="open" v-model="open"
append-to-body append-to-body
@ -28,6 +28,7 @@ const userStore = useUserStore()
const open = ref(false) const open = ref(false)
const visible = ref(false) const visible = ref(false)
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
// //
const options = reactive({ const options = reactive({
@ -56,7 +57,7 @@ function uploadImg(data) {
formData.append('avatarfile', data) formData.append('avatarfile', data)
uploadAvatar(formData).then((response) => { uploadAvatar(formData).then((response) => {
open.value = false open.value = false
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl options.img = response.imgUrl
userStore.user.avatar = options.img userStore.user.avatar = options.img
ElMessage({ ElMessage({
message: '上传成功', message: '上传成功',