lrf há 8 meses atrás
pai
commit
1ca8f7ad91
2 ficheiros alterados com 3 adições e 3 exclusões
  1. 1 1
      src/router/index.js
  2. 2 2
      src/router/register.js

+ 1 - 1
src/router/index.js

@@ -279,7 +279,7 @@ const getRedirectUri = (route) => {
 const centerRoutePagePath = '/info/loading'
 router.beforeEach(async (to, from, next) => {
   const userStore = UserStore()
-  document.title = `${to.meta.title} `
+  document.title = get(to, 'meta.title', '产学研用协同创新数字化平台')
   const routeCheck = isInCenter(to)
   // 进入个人中心,检查是否有token,没有token直接返回login
   const token = localStorage.getItem('token')

+ 2 - 2
src/router/register.js

@@ -4,13 +4,13 @@ export const addUserRoutes = (menus, router) => {
   const __def = 'Layout'
   const loadComponent = import.meta.glob('../views/**/*.vue')
   for (const m of menuArr) {
-    const { path, route_name, type, component } = m
+    const { path, route_name, type, component, name } = m
     const getComponent = loadComponent[`../views${component}.vue`]
     const route = {
       path: path,
       name: route_name,
       meta: {
-        title: route_name,
+        title: `${name}`,
         type
       },
       component: getComponent