feat: 外观设置

This commit is contained in:
wangdan-fit2cloud 2024-07-16 17:39:15 +08:00
parent 7a9d8bf96d
commit ffc896666f
2 changed files with 9 additions and 9 deletions

View File

@ -20,11 +20,11 @@ defineOptions({ name: 'LoginLayout' })
const { user } = useStore()
const fileURL = computed(() => {
if (user.themeInfo.loginImage) {
if (typeof user.themeInfo.loginImage === 'string') {
return user.themeInfo.loginImage
if (user.themeInfo?.loginImage) {
if (typeof user.themeInfo?.loginImage === 'string') {
return user.themeInfo?.loginImage
} else {
return URL.createObjectURL(user.themeInfo.loginImage)
return URL.createObjectURL(user.themeInfo?.loginImage)
}
} else {
return ''

View File

@ -1,5 +1,5 @@
<template>
<img v-if="user.themeInfo.loginLogo" :src="fileURL" alt="" height="45px" class="mr-8" />
<img v-if="user.themeInfo?.loginLogo" :src="fileURL" alt="" height="45px" class="mr-8" />
<template v-else>
<svg
v-if="!isDefaultTheme"
@ -75,11 +75,11 @@ const isDefaultTheme = computed(() => {
})
const fileURL = computed(() => {
if (user.themeInfo.loginLogo) {
if (typeof user.themeInfo.loginLogo === 'string') {
return user.themeInfo.loginLogo
if (user.themeInfo?.loginLogo) {
if (typeof user.themeInfo?.loginLogo === 'string') {
return user.themeInfo?.loginLogo
} else {
return URL.createObjectURL(user.themeInfo.loginLogo)
return URL.createObjectURL(user.themeInfo?.loginLogo)
}
} else {
return ''