feat: 头像更细
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
<img src="@/assets/images/profile-content-bg.jpg" alt="" />
|
||||
<div class="content">
|
||||
<div class="profile">
|
||||
<img class="profile-avatar" :src="userInfoStore.state.userInfo.avatarUrl" alt="" />
|
||||
<img class="profile-avatar" :src="userInfo.avatarUrl" alt="" />
|
||||
</div>
|
||||
<div class="name">
|
||||
{{ $t('MainHeader.HiName', { name: userInfo.username }) }}
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
import AvatarCropDialog from './AvatarCropDialog.vue'
|
||||
import type { RoleOption, RoleValue, SettingsData } from '../types'
|
||||
import { uploadFile, updateUserAvatar } from '@/api/user'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
|
||||
const props = defineProps<{
|
||||
displayData: SettingsData
|
||||
@@ -178,6 +179,7 @@
|
||||
}
|
||||
|
||||
await updateUserAvatar({ avatarUrl: url })
|
||||
useUserInfoStore().setAvatarUrl(url)
|
||||
ElMessage.success(t('Settings.messages.avatarUpdated'))
|
||||
emit('avatar-updated', url)
|
||||
} catch (err) {
|
||||
@@ -205,9 +207,9 @@
|
||||
isAvatarCropDialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleAvatarCropConfirm = async (file: File) => {
|
||||
const handleAvatarCropConfirm = (file: File) => {
|
||||
closeAvatarCropDialog()
|
||||
await uploadAvatarFile(file)
|
||||
uploadAvatarFile(file)
|
||||
}
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
Reference in New Issue
Block a user