系统名称使用变量修正

This commit is contained in:
yaoyn
2025-05-30 11:29:54 +08:00
parent 88c193fc0e
commit e2d478c851
5 changed files with 17 additions and 9 deletions

View File

@ -4,10 +4,10 @@
-->
<template>
<div class="anticon" :class="getAppLogoClass" @click="goHome">
<a href="https://fcdma.gdyditc.com/" target="_blank">
<a :href="sysImgGotoUrl" target="_blank">
<img :src="logoConfig.menuLogoUrl || logo" width="24" style="height: 36px" />
<div class="truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
{{ sysName }}
<div class="truncate md:opacity-100" :class="getTitleClass" v-show="showTitle" :title="sysShortName || sysName">
{{ sysShortName || sysName }}
</div>
</a>
</div>
@ -42,7 +42,9 @@
const go = useGo();
const appStore = useAppStore();
const logoConfig = appStore.getLogoConfig;
const sysShortName = ref(import.meta.env.VITE_SYSTEM_SHORT_NAME);
const sysName = ref(import.meta.env.VITE_SYSTEM_NAME);
const sysImgGotoUrl = ref(import.meta.env.VITE_SYSTEM_IMG_GOTO_URL);
const getAppLogoClass = computed(() => [prefixCls, props.theme, { 'collapsed-show-title': unref(getCollapsedShowTitle) }]);
const getTitleClass = computed(() => [

View File

@ -11,7 +11,7 @@ import { REDIRECT_NAME } from '/@/router/constant';
* Listening to page changes and dynamically changing site titles
*/
export function useTitle() {
const title = import.meta.env.VITE_SYSTEM_NAME;
const title = import.meta.env.VITE_GLOB_APP_TITLE;
const { t } = useI18n();
const { currentRoute } = useRouter();
const localeStore = useLocaleStore();

View File

@ -25,6 +25,7 @@
import { useUserStore } from '/@/store/modules/user';
import { useTabs } from '/@/hooks/web/useTabs';
import { useTitle } from '@vueuse/core';
import {useGlobSetting} from "/@/hooks/setting";
const loading = ref(true);
const desktop = reactive({ hasCustomDesktop: false, list: [] });
@ -39,6 +40,7 @@
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const { setTitle } = useTabs();
const { title } = useGlobSetting();
watch(
() => userInfo.desktopSchema,
@ -56,7 +58,7 @@
//设置Tab标题
setTitle(desktopSchema.name);
//设置浏览器标题
useTitle(` ${desktopSchema.name} `);
useTitle(` ${desktopSchema.name} - ${title} `);
desktop.hasCustomDesktop = true;
}
}