From dd1ddffc5646e7f96a41002b42d8cb5bf5d700dc Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 16 Mar 2023 10:10:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=80=9A=E7=94=A8=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E8=87=AA=E5=AE=9A=E4=B9=89=E6=B5=8F=E8=A7=88=E5=99=A8title?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=BB=B6=E8=BF=9F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023918 --user=赵勇 [通用设置] github#22343设置页面title后,访问metersphere,title加载过慢 https://www.tapd.cn/55049933/s/1351069 Signed-off-by: fit2-zhao --- framework/sdk-parent/frontend/src/router/index.js | 1 + framework/sdk-parent/frontend/src/router/permission.js | 1 + 2 files changed, 2 insertions(+) diff --git a/framework/sdk-parent/frontend/src/router/index.js b/framework/sdk-parent/frontend/src/router/index.js index 538834e66b..e6c834160d 100644 --- a/framework/sdk-parent/frontend/src/router/index.js +++ b/framework/sdk-parent/frontend/src/router/index.js @@ -71,6 +71,7 @@ import('@/store').then(async ({useUserStore}) => { let store = null; router.beforeEach(async (to, from, next) => { + document.title = localStorage.getItem("default-document-title") || "MeterSphere"; if (store === null) { const {useUserStore} = await import('@/store'); store = useUserStore(); diff --git a/framework/sdk-parent/frontend/src/router/permission.js b/framework/sdk-parent/frontend/src/router/permission.js index 158c6ef785..f5da1d591f 100644 --- a/framework/sdk-parent/frontend/src/router/permission.js +++ b/framework/sdk-parent/frontend/src/router/permission.js @@ -8,6 +8,7 @@ const whiteList = ["/login"] // no redirect whitelist let store = null; router.beforeEach(async (to, from, next) => { + document.title = localStorage.getItem("default-document-title") || "MeterSphere"; // start progress bar NProgress.start();