From b71236ba06828188336ecf312365a6aafa617d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 7 Dec 2023 14:18:14 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=A4=84=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++++- src/permission.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index c7e4c6c..d187f5a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,9 +52,13 @@ export default { }, // 导航标题(国际化) pageTitle () { - if (!this.$route.meta.pageTitle) { + if (!this.$route.meta.pageTitle && !this.$route.meta.title) { return '' } + // 路由守卫处理了把taskName赋值给title了 + if (this.$route.meta.title) { + return this.$route.meta.title + } return this.$t('pageTitle.' + this.$route.meta.pageTitle) }, // 是否白色头部导航 diff --git a/src/permission.js b/src/permission.js index d295000..bba467d 100644 --- a/src/permission.js +++ b/src/permission.js @@ -26,6 +26,9 @@ router.beforeEach(async (to, from, next) => { if (to.path === '/user/login') { next('/') } else { + if (to.query.taskName) { + to.meta.title = to.query.taskName + } next() } } else {