| | |
| | | <script lang="ts" setup> |
| | | import { computed } from 'vue'; |
| | | import { computed, onMounted } from 'vue'; |
| | | |
| | | import { AuthPageLayout } from '@vben/layouts'; |
| | | import { preferences } from '@vben/preferences'; |
| | | |
| | | import { $t } from '#/locales'; |
| | | import { useCompanyConfigStore } from '#/store/company-config'; |
| | | |
| | | declare const __APP_LOGO__: string; |
| | | |
| | | const appName = computed(() => preferences.app.name); |
| | | const companyConfigStore = useCompanyConfigStore(); |
| | | |
| | | onMounted(() => { |
| | | // 登录页展示 loginTitle:启动加载走的是纯函数(不填 store),进入登录页时拉取一次 |
| | | companyConfigStore.loadFromServer(); |
| | | }); |
| | | |
| | | const appName = computed(() => preferences.copyright.companyName); |
| | | const logo = computed(() => __APP_LOGO__ || preferences.logo.source); |
| | | const logoDark = computed(() => preferences.logo.sourceDark); |
| | | // 登录页标题/描述优先取后端配置,未配置时回退到 i18n 默认 |
| | | const pageTitle = computed( |
| | | () => companyConfigStore.loginTitle || $t('authentication.pageTitle'), |
| | | ); |
| | | const pageDescription = computed( |
| | | () => companyConfigStore.loginDescription || $t('authentication.pageDesc'), |
| | | ); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | :app-name="appName" |
| | | :logo="logo" |
| | | :logo-dark="logoDark" |
| | | :page-description="$t('authentication.pageDesc')" |
| | | :page-title="$t('authentication.pageTitle')" |
| | | :page-description="pageDescription" |
| | | :page-title="pageTitle" |
| | | > |
| | | <!-- 自定义工具栏 --> |
| | | <!-- <template #toolbar></template> --> |