perf: 修复站点个性化,浏览器标题没有生效的bug

pull/243/head
xiaojunnuo 2024-11-13 09:31:56 +08:00
parent 60a2ed48c2
commit bcfac02c96
2 changed files with 4 additions and 3 deletions

View File

@ -69,7 +69,8 @@ router.afterEach((to: any) => {
// } // }
pageStore.open(to); pageStore.open(to);
// 更改标题 // 更改标题
site.title(to.meta.title); const settingStore = useSettingStore();
site.title(to.meta.title, settingStore.siteInfo.title);
//修改左侧边栏 //修改左侧边栏
const matched = to.matched; const matched = to.matched;

View File

@ -4,8 +4,8 @@ export const site = {
* @description * @description
* @param titleText * @param titleText
*/ */
title: function (titleText: string) { title: function (titleText: string, baseTitle?: string) {
const processTitle = env.TITLE || "FsAdmin"; const processTitle = baseTitle || env.TITLE || "Certd";
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ""}`; window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ""}`;
} }
}; };