【issues/7500】vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去

This commit is contained in:
JEECG
2024-11-27 18:41:24 +08:00
parent 32c8370ef2
commit e2aaf0f978
4 changed files with 20 additions and 10 deletions

View File

@ -1,13 +1,12 @@
import type { AppRouteRecordRaw } from '/@/router/types';
import { t } from '/@/hooks/web/useI18n';
import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME } from '/@/router/constant';
import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME, PAGE_NOT_FOUND_NAME_404 } from '/@/router/constant';
// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
path: '/:path(.*)*',
// update-begin--author:liaozhiyang---date:202401127---for【issues/7500】vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去
name: 'PageNotFound404',
// update-end--author:liaozhiyang---date:202401127---for【issues/7500】vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去
name: PAGE_NOT_FOUND_NAME,
component: LAYOUT,
meta: {
title: 'ErrorPage',
@ -17,7 +16,9 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
children: [
{
path: '/:path(.*)*',
name: PAGE_NOT_FOUND_NAME,
// update-begin--author:liaozhiyang---date:202401127---for【issues/7500】vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去
name: PAGE_NOT_FOUND_NAME_404,
// update-end--author:liaozhiyang---date:202401127---for【issues/7500】vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去
component: EXCEPTION_COMPONENT,
meta: {
title: 'ErrorPage',