mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
support set gravatar as user avatar provider
This commit is contained in:
@@ -16,6 +16,10 @@ export const useUserStore = defineStore('user', {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.nickname || userInfo.username || null;
|
||||
},
|
||||
currentUserAvatar(state) {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.avatar || null;
|
||||
},
|
||||
currentUserDefaultAccountId(state) {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.defaultAccountId || '';
|
||||
|
||||
@@ -113,14 +113,16 @@
|
||||
<v-icon :icon="(theme === 'light' ? icons.themeLight : (theme === 'dark' ? icons.themeDark : icons.themeAuto))" size="24" />
|
||||
</v-btn>
|
||||
<v-avatar class="cursor-pointer" color="primary" variant="tonal">
|
||||
<v-icon :icon="icons.user"/>
|
||||
<v-img :src="currentUserAvatar" v-if="currentUserAvatar"/>
|
||||
<v-icon :icon="icons.user" v-else-if="!currentUserAvatar"/>
|
||||
<v-menu activator="parent" width="230" location="bottom end" offset="14px">
|
||||
<v-list>
|
||||
<v-list-item>
|
||||
<template #prepend>
|
||||
<v-list-item-action start>
|
||||
<v-avatar color="primary" variant="tonal">
|
||||
<v-icon :icon="icons.user"/>
|
||||
<v-img :src="currentUserAvatar" v-if="currentUserAvatar"/>
|
||||
<v-icon :icon="icons.user" v-else-if="!currentUserAvatar"/>
|
||||
</v-avatar>
|
||||
</v-list-item-action>
|
||||
</template>
|
||||
@@ -264,6 +266,9 @@ export default {
|
||||
currentNickName() {
|
||||
return this.userStore.currentUserNickname || this.$t('User');
|
||||
},
|
||||
currentUserAvatar() {
|
||||
return this.userStore.currentUserAvatar;
|
||||
},
|
||||
theme: {
|
||||
get: function () {
|
||||
return this.settingsStore.appSettings.theme;
|
||||
|
||||
Reference in New Issue
Block a user