refactor(通用设置): 自定义浏览器title加载延迟优化

--bug=1023918 --user=赵勇 [通用设置] github#22343设置页面title后,访问metersphere,title加载过慢 https://www.tapd.cn/55049933/s/1351069

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-03-16 10:10:00 +08:00 committed by fit2-zhao
parent 49767cb59e
commit dd1ddffc56
2 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ import('@/store').then(async ({useUserStore}) => {
let store = null; let store = null;
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
document.title = localStorage.getItem("default-document-title") || "MeterSphere";
if (store === null) { if (store === null) {
const {useUserStore} = await import('@/store'); const {useUserStore} = await import('@/store');
store = useUserStore(); store = useUserStore();

View File

@ -8,6 +8,7 @@ const whiteList = ["/login"] // no redirect whitelist
let store = null; let store = null;
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
document.title = localStorage.getItem("default-document-title") || "MeterSphere";
// start progress bar // start progress bar
NProgress.start(); NProgress.start();