Browse Source

fix: 修复前端路由重复报错

fix-permisson
WangJunZzz 1 year ago
parent
commit
6bbbe24312
  1. 2
      .gitignore
  2. 2
      vben28/src/router/constant.ts
  3. 3
      vben28/src/router/routes/basic.ts
  4. 4
      vben28/src/router/routes/modules/tenant.ts

2
.gitignore

@ -21,7 +21,7 @@ bld/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
[Ll]og/ [Ll]og/
.DS_Store
# Visual Studio 2015 cache/options directory # Visual Studio 2015 cache/options directory
.vs/ .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot # Uncomment if you have tasks that create the project's static files in wwwroot

2
vben28/src/router/constant.ts

@ -4,6 +4,8 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
export const PAGE_NOT_FOUND_NAME = 'PageNotFound'; export const PAGE_NOT_FOUND_NAME = 'PageNotFound';
export const PAGE_NOT_FOUND_NAME_PATH = 'PageNotFoundPath';
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue'); export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue');
/** /**

3
vben28/src/router/routes/basic.ts

@ -5,6 +5,7 @@ import {
LAYOUT, LAYOUT,
EXCEPTION_COMPONENT, EXCEPTION_COMPONENT,
PAGE_NOT_FOUND_NAME, PAGE_NOT_FOUND_NAME,
PAGE_NOT_FOUND_NAME_PATH,
} from '/@/router/constant'; } from '/@/router/constant';
// 404 on a page // 404 on a page
@ -20,7 +21,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
children: [ children: [
{ {
path: '/:path(.*)*', path: '/:path(.*)*',
name: PAGE_NOT_FOUND_NAME, name: PAGE_NOT_FOUND_NAME_PATH,
component: EXCEPTION_COMPONENT, component: EXCEPTION_COMPONENT,
meta: { meta: {
title: 'ErrorPage', title: 'ErrorPage',

4
vben28/src/router/routes/modules/tenant.ts

@ -13,8 +13,8 @@ const tenant: AppRouteModule = {
}, },
children: [ children: [
{ {
path: 'Tenant', path: 'Page',
name: 'Tenant', name: 'TenantPage',
component: () => import('/@/views/tenants/Tenant.vue'), component: () => import('/@/views/tenants/Tenant.vue'),
meta: { meta: {
title: t('routes.tenant.tenantList'), title: t('routes.tenant.tenantList'),

Loading…
Cancel
Save