lrf 1 rok pred
rodič
commit
48113cc5b4

+ 2 - 1
src/components/Breadcrumb/index.vue

@@ -20,6 +20,7 @@ import { compile } from 'path-to-regexp'
 import router from '@/router'
 
 const currentRoute = useRoute()
+const { t } = useI18n()
 const pathCompile = (path) => {
   const { params } = currentRoute
   const toPath = compile(path)
@@ -44,7 +45,7 @@ function isDashboard(route) {
   if (!name) {
     return false
   }
-  return name.toString().trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
+  return name.toString().trim().toLocaleLowerCase() === 'home'.toLocaleLowerCase()
 }
 
 function handleLink(item) {

+ 1 - 1
src/router/guard.js

@@ -51,7 +51,7 @@ export const registerBeforeRouter = async (router) => {
         next({ ...to, replace: true })
       }
     } else {
-      next()
+      next('/login')
     }
   })
 }

+ 3 - 3
src/router/index.js

@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
 import { registerBeforeRouter } from './guard'
 export const homeIndex = () => import('@/views/home/index.vue')
 export const Layout = () => import('@/layout/index.vue')
-
+import i18n from '@/lang'
 // 静态路由
 export const constantRoutes = [
   {
@@ -29,9 +29,9 @@ export const constantRoutes = [
     children: [
       {
         path: '/',
-        name: 'dashboard',
+        name: 'home',
         meta: {
-          title: 'dashboard',
+          title: i18n.global.t('menus.home'),
           affix: true,
           keepAlive: true,
           alwaysShow: false