feat: 支持配置系统图标
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-shell home">
|
||||
<div class="logo">艺</div>
|
||||
<img class="logo" :src="appIconUrl" alt="" />
|
||||
<h1>{{ t('home.title') }}</h1>
|
||||
<p class="muted">{{ t('home.hint') }}</p>
|
||||
<button class="lang" @click="toggleLang">{{ otherLangLabel }}</button>
|
||||
@@ -16,9 +16,11 @@ import { computed, onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { fetchAppInfo } from '@/api';
|
||||
import { setLocale } from '@/locales';
|
||||
import { resolveAppIcon, setFavicon } from '@/utils/appIcon';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const appName = ref('');
|
||||
const appIconUrl = ref(resolveAppIcon());
|
||||
const filingInfo = ref('');
|
||||
const otherLangLabel = computed(() => (locale.value === 'zh-CN' ? 'EN' : '中文'));
|
||||
function toggleLang() {
|
||||
@@ -28,9 +30,12 @@ onMounted(async () => {
|
||||
try {
|
||||
const info = await fetchAppInfo();
|
||||
appName.value = info?.appName || t('app.name');
|
||||
appIconUrl.value = resolveAppIcon(info?.appIconUrl);
|
||||
setFavicon(appIconUrl.value);
|
||||
filingInfo.value = info?.filingInfo || '';
|
||||
} catch {
|
||||
appName.value = t('app.name');
|
||||
setFavicon(appIconUrl.value);
|
||||
filingInfo.value = '';
|
||||
}
|
||||
});
|
||||
@@ -50,13 +55,8 @@ onMounted(async () => {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 18px;
|
||||
background: linear-gradient(135deg, #1f3864, #2e5496);
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
object-fit: cover;
|
||||
background: #f6f8fb;
|
||||
}
|
||||
h1 {
|
||||
font-size: 22px;
|
||||
|
||||
Reference in New Issue
Block a user