mirror of https://github.com/certd/certd
chore: useTitle
parent
065713cdb6
commit
2c6d64976f
|
@ -10,7 +10,7 @@ import { useUserStore } from "/@/store/modules/user";
|
|||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { env } from "/@/utils/util.env";
|
||||
import { updatePreferences } from "/@/vben/preferences";
|
||||
|
||||
import { useTitle } from "@vueuse/core";
|
||||
export interface SettingState {
|
||||
sysPublic?: SysPublicSetting;
|
||||
installInfo?: {
|
||||
|
@ -146,6 +146,14 @@ export const useSettingStore = defineStore({
|
|||
}
|
||||
});
|
||||
}
|
||||
if (this.siteInfo.title) {
|
||||
updatePreferences({
|
||||
app: {
|
||||
name: this.siteInfo.title
|
||||
}
|
||||
});
|
||||
useTitle(this.siteInfo.title);
|
||||
}
|
||||
},
|
||||
async checkUrlBound() {
|
||||
const userStore = useUserStore();
|
||||
|
|
|
@ -16,8 +16,8 @@ export async function setupVben(app: any, { loadMessages, router }: any) {
|
|||
const store = await initStores(app, { namespace: "fs" });
|
||||
watchEffect(() => {
|
||||
if (preferences.app.dynamicTitle) {
|
||||
const routeTitle = router.currentRoute.value.title;
|
||||
const pageTitle = routeTitle || "" + preferences.app.name;
|
||||
const routeTitle = router.currentRoute.value.meta?.title;
|
||||
const pageTitle = (routeTitle ? `${routeTitle} - ` : "") + preferences.app.name;
|
||||
useTitle(pageTitle);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ const defaultPreferences: Preferences = {
|
|||
layout: "mixed-nav",
|
||||
locale: "zh-CN",
|
||||
loginExpiredMode: "page",
|
||||
name: "FsAdmin",
|
||||
name: "",
|
||||
preferencesButtonPosition: "auto",
|
||||
watermark: false
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue