<script lang="ts" setup>
|
import { computed, onMounted } from 'vue';
|
|
import { preferences, usePreferences } from '@vben/preferences';
|
|
import { useCompanyConfigStore } from '#/store/company-config';
|
import AuthenticationToolbar from '../packages/effects/layouts/src/authentication/toolbar.vue';
|
import AuthScene from './auth-scene.vue';
|
|
declare const __APP_LOGO__: string;
|
|
const companyConfigStore = useCompanyConfigStore();
|
const { isDark } = usePreferences();
|
|
onMounted(() => {
|
// 登录页展示 loginTitle:启动加载走的是纯函数(不填 store),进入登录页时拉取一次
|
companyConfigStore.loadFromServer();
|
});
|
|
const appName = computed(() => preferences.copyright.companyName);
|
// 登录页 logo 优先取数据库配置(preferences.logo.source),未配置时回退编译期默认 __APP_LOGO__
|
const logo = computed(() => {
|
const source = (isDark.value && preferences.logo.sourceDark) || preferences.logo.source || __APP_LOGO__;
|
// 未配置公司标志时不展示框架演示 Logo。
|
return source?.includes('@vbenjs/static-source') ? '' : source;
|
});
|
const pageTitle = computed(() => companyConfigStore.loginTitle || '滋补品行业数字化管理平台');
|
const pageDescription = computed(() => companyConfigStore.loginDescription || '传承中医药精华 · 服务健康美好生活');
|
</script>
|
|
<template>
|
<AuthScene
|
:app-name="appName"
|
:logo="logo"
|
:platform-description="pageDescription"
|
:platform-title="pageTitle"
|
>
|
<template #toolbar><AuthenticationToolbar :toolbar-list="['language', 'theme']" /></template>
|
<RouterView v-slot="{ Component, route }">
|
<KeepAlive :include="['Login']">
|
<component :is="Component" :key="route.fullPath" />
|
</KeepAlive>
|
</RouterView>
|
</AuthScene>
|
</template>
|