feat: bugfix

This commit is contained in:
zdl
2025-10-31 10:33:53 +08:00
parent f05daa3a78
commit 5d8ad5e442
34 changed files with 314 additions and 3579 deletions

View File

@@ -1,5 +1,5 @@
// src/routes/constants/index.js
// 统一导出所有路由常量
export { LAYOUT_COMPONENTS } from './layoutComponents';
export { PROTECTION_WRAPPER_MAP } from './protectionWrappers';
export { PROTECTION_MODES } from './protectionModes';

View File

@@ -1,26 +0,0 @@
// src/routes/constants/layoutComponents.js
// 布局组件映射表
import Auth from '@layouts/Auth';
import HomeLayout from '@layouts/Home';
/**
* 特殊布局组件映射表
*
* 用于将字符串标识符映射到实际的组件。
* 这些是非懒加载的布局组件,在 routeConfig.js 中通过字符串引用。
*
* @example
* // 在 routeConfig.js 中:
* {
* path: 'auth/*',
* component: 'Auth', // 字符串标识符
* ...
* }
*
* // 通过 LAYOUT_COMPONENTS['Auth'] 获取实际组件
*/
export const LAYOUT_COMPONENTS = {
Auth,
HomeLayout,
};

View File

@@ -0,0 +1,14 @@
// src/routes/constants/protectionModes.js
// 路由保护模式常量
/**
* 路由保护模式
* - 'modal': 使用 ProtectedRoute (弹窗模式登录)
* - 'redirect': 使用 ProtectedRouteRedirect (跳转模式登录)
* - 'public': 公开访问,无需登录
*/
export const PROTECTION_MODES = {
MODAL: 'modal',
REDIRECT: 'redirect',
PUBLIC: 'public',
};

View File

@@ -3,7 +3,7 @@
import ProtectedRoute from '@components/ProtectedRoute';
import ProtectedRouteRedirect from '@components/ProtectedRouteRedirect';
import { PROTECTION_MODES } from '../routeConfig';
import { PROTECTION_MODES } from './protectionModes';
/**
* 保护模式包装器映射表