系统名称使用变量修正
This commit is contained in:
6
.env
6
.env
@ -4,11 +4,13 @@ VITE_PORT = 3100
|
||||
# spa-title
|
||||
VITE_GLOB_APP_TITLE = 全代码平台
|
||||
|
||||
# spa shortname
|
||||
# spa shortname(英文缩写)
|
||||
VITE_GLOB_APP_SHORT_NAME = 全代码平台
|
||||
|
||||
# 应用名称
|
||||
# 应用名称(仅展示在登录页和左上角logo旁,其他情况用VITE_GLOB_APP_TITLE)
|
||||
VITE_SYSTEM_NAME = 全代码平台
|
||||
# 应用名称简写,用于空间不足的界面显示(左上角logo旁,7个字以内,超出变成...)
|
||||
# VITE_SYSTEM_SHORT_NAME = 全代码平台
|
||||
|
||||
# 响应式布局的表单宽度分界
|
||||
VITE_RESP_LG_WIDTH = 1280
|
||||
|
||||
@ -33,9 +33,11 @@
|
||||
const { data } = await responseStream.json();
|
||||
if (data.shortName) {
|
||||
document.title = data.shortName;
|
||||
if(document.getElementById('app-loading-title')){
|
||||
document.getElementById('app-loading-title').innerText = data.shortName;
|
||||
}
|
||||
if (data.refreshLogoUrl) {
|
||||
}
|
||||
if (data.refreshLogoUrl&&document.getElementById('app-loading-logo')) {
|
||||
document.getElementById('app-loading-logo').setAttribute('src', data.refreshLogoUrl);
|
||||
}
|
||||
} catch {
|
||||
|
||||
@ -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(() => [
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user