style: 调整 Logo 样式 (#4357)

This commit is contained in:
ssongliu 2024-03-29 17:24:07 +08:00 committed by GitHub
parent 1527c63d37
commit 471b7d9657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<template>
<div>
<el-dialog v-model="open" :close-on-click-modal="false" @close="handleClose">
<div style="text-align: center">
<div style="text-align: center" v-loading="loading">
<span class="text-3xl font-medium">{{ $t('license.levelUpPro') }}</span>
<el-row type="flex" justify="center" class="mt-6">
<el-col :span="22">

View File

@ -1458,7 +1458,7 @@ const message = {
license: 'License',
},
License: {
license: {
community: 'Community Edition',
pro: 'Professional Edition',
trial: 'Trial Edition',

View File

@ -1358,7 +1358,7 @@ const message = {
license: '許可證',
},
License: {
license: {
community: '社區版',
pro: '專業版',
trial: '試用版',

View File

@ -36,7 +36,7 @@ const getLogoUrl = (isCollapse: boolean) => {
img {
object-fit: contain;
width: 95%;
height: 40px;
height: 50px;
}
}
</style>

View File

@ -75,7 +75,6 @@ const loadDataFromDB = async () => {
const loadDataFromXDB = async () => {
const res = await searchXSetting();
localStorage.setItem('1p-favicon', res.data.logo);
globalStore.themeConfig.title = res.data.title;
globalStore.themeConfig.logo = res.data.logo;
globalStore.themeConfig.logoWithText = res.data.logoWithText;
@ -110,7 +109,7 @@ const updateDarkMode = async (event: MediaQueryListEvent) => {
};
const initFavicon = () => {
let favicon = localStorage.getItem('1p-favicon');
let favicon = globalStore.themeConfig.favicon;
const link = (document.querySelector("link[rel*='icon']") || document.createElement('link')) as HTMLLinkElement;
link.type = 'image/x-icon';
link.rel = 'shortcut icon';

View File

@ -319,9 +319,19 @@ const loadLanguage = async () => {
} catch (error) {}
};
const loadFavicon = () => {
let favicon = globalStore.themeConfig.favicon;
const link = (document.querySelector("link[rel*='icon']") || document.createElement('link')) as HTMLLinkElement;
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = favicon ? '/api/v1/images/favicon' : '/public/favicon.png';
document.getElementsByTagName('head')[0].appendChild(link);
};
onMounted(() => {
globalStore.isOnRestart = false;
loginVerify();
loadFavicon();
loadLanguage();
document.title = globalStore.themeConfig.panelName;
loginForm.agreeLicense = globalStore.agreeLicense;