系统名称使用变量修正
This commit is contained in:
6
.env
6
.env
@ -4,11 +4,13 @@ VITE_PORT = 3100
|
|||||||
# spa-title
|
# spa-title
|
||||||
VITE_GLOB_APP_TITLE = 全代码平台
|
VITE_GLOB_APP_TITLE = 全代码平台
|
||||||
|
|
||||||
# spa shortname
|
# spa shortname(英文缩写)
|
||||||
VITE_GLOB_APP_SHORT_NAME = 全代码平台
|
VITE_GLOB_APP_SHORT_NAME = 全代码平台
|
||||||
|
|
||||||
# 应用名称
|
# 应用名称(仅展示在登录页和左上角logo旁,其他情况用VITE_GLOB_APP_TITLE)
|
||||||
VITE_SYSTEM_NAME = 全代码平台
|
VITE_SYSTEM_NAME = 全代码平台
|
||||||
|
# 应用名称简写,用于空间不足的界面显示(左上角logo旁,7个字以内,超出变成...)
|
||||||
|
# VITE_SYSTEM_SHORT_NAME = 全代码平台
|
||||||
|
|
||||||
# 响应式布局的表单宽度分界
|
# 响应式布局的表单宽度分界
|
||||||
VITE_RESP_LG_WIDTH = 1280
|
VITE_RESP_LG_WIDTH = 1280
|
||||||
|
|||||||
@ -33,9 +33,11 @@
|
|||||||
const { data } = await responseStream.json();
|
const { data } = await responseStream.json();
|
||||||
if (data.shortName) {
|
if (data.shortName) {
|
||||||
document.title = data.shortName;
|
document.title = data.shortName;
|
||||||
document.getElementById('app-loading-title').innerText = 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);
|
document.getElementById('app-loading-logo').setAttribute('src', data.refreshLogoUrl);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="anticon" :class="getAppLogoClass" @click="goHome">
|
<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" />
|
<img :src="logoConfig.menuLogoUrl || logo" width="24" style="height: 36px" />
|
||||||
<div class="truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
|
<div class="truncate md:opacity-100" :class="getTitleClass" v-show="showTitle" :title="sysShortName || sysName">
|
||||||
{{ sysName }}
|
{{ sysShortName || sysName }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -42,7 +42,9 @@
|
|||||||
const go = useGo();
|
const go = useGo();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const logoConfig = appStore.getLogoConfig;
|
const logoConfig = appStore.getLogoConfig;
|
||||||
|
const sysShortName = ref(import.meta.env.VITE_SYSTEM_SHORT_NAME);
|
||||||
const sysName = ref(import.meta.env.VITE_SYSTEM_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 getAppLogoClass = computed(() => [prefixCls, props.theme, { 'collapsed-show-title': unref(getCollapsedShowTitle) }]);
|
||||||
|
|
||||||
const getTitleClass = computed(() => [
|
const getTitleClass = computed(() => [
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { REDIRECT_NAME } from '/@/router/constant';
|
|||||||
* Listening to page changes and dynamically changing site titles
|
* Listening to page changes and dynamically changing site titles
|
||||||
*/
|
*/
|
||||||
export function useTitle() {
|
export function useTitle() {
|
||||||
const title = import.meta.env.VITE_SYSTEM_NAME;
|
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const localeStore = useLocaleStore();
|
const localeStore = useLocaleStore();
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { useTabs } from '/@/hooks/web/useTabs';
|
import { useTabs } from '/@/hooks/web/useTabs';
|
||||||
import { useTitle } from '@vueuse/core';
|
import { useTitle } from '@vueuse/core';
|
||||||
|
import {useGlobSetting} from "/@/hooks/setting";
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const desktop = reactive({ hasCustomDesktop: false, list: [] });
|
const desktop = reactive({ hasCustomDesktop: false, list: [] });
|
||||||
@ -39,6 +40,7 @@
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
const { setTitle } = useTabs();
|
const { setTitle } = useTabs();
|
||||||
|
const { title } = useGlobSetting();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => userInfo.desktopSchema,
|
() => userInfo.desktopSchema,
|
||||||
@ -56,7 +58,7 @@
|
|||||||
//设置Tab标题
|
//设置Tab标题
|
||||||
setTitle(desktopSchema.name);
|
setTitle(desktopSchema.name);
|
||||||
//设置浏览器标题
|
//设置浏览器标题
|
||||||
useTitle(` ${desktopSchema.name} `);
|
useTitle(` ${desktopSchema.name} - ${title} `);
|
||||||
desktop.hasCustomDesktop = true;
|
desktop.hasCustomDesktop = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user