chore: default avatar

This commit is contained in:
dap 2024-10-06 16:19:39 +08:00
parent a448ff8115
commit ddf90ec4a8
2 changed files with 4 additions and 9 deletions

View File

@ -3,7 +3,7 @@ import type { UserProfile } from '#/api/system/profile/model';
import { computed } from 'vue'; import { computed } from 'vue';
import { usePreferences } from '@vben/preferences'; import { preferences, usePreferences } from '@vben/preferences';
import { import {
Card, Card,
@ -24,9 +24,7 @@ defineEmits<{
}>(); }>();
const avatar = computed( const avatar = computed(
() => () => props.profile?.user.avatar ?? preferences.app.defaultAvatar,
props.profile?.user.avatar ??
'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
); );
const { isDark } = usePreferences(); const { isDark } = usePreferences();

View File

@ -10,6 +10,7 @@ import {
type VbenFormProps, type VbenFormProps,
} from '@vben/common-ui'; } from '@vben/common-ui';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
import { preferences } from '@vben/preferences';
import { getPopupContainer } from '@vben/utils'; import { getPopupContainer } from '@vben/utils';
import { import {
@ -122,7 +123,6 @@ const gridOptions: VxeGridProps = {
align: 'center', align: 'center',
showOverflow: true, showOverflow: true,
}; };
const checked = ref(false); const checked = ref(false);
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
@ -236,10 +236,7 @@ function handleResetPwd(record: Recordable<any>) {
</template> </template>
<template #avatar="{ row }"> <template #avatar="{ row }">
<Avatar v-if="row.avatar" :src="row.avatar" /> <Avatar v-if="row.avatar" :src="row.avatar" />
<Avatar <Avatar v-else :src="preferences.app.defaultAvatar" />
v-else
src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
/>
</template> </template>
<template #status="{ row }"> <template #status="{ row }">
<TableSwitch <TableSwitch