fix(frontend): 修复 SPA 深链直访白屏(vite base 改为绝对路径)

- base: './' → '/',避免 /audit/terminal 等路径下 assets 404
- 审计页改为独立路由组件,支持 URL 直链
This commit is contained in:
Logan.Li committed 2026-06-26 11:02:27 +08:00
1 parent 521bfd356f
commit 992e9b2ecc
2 files changed
+9 -6

No files matched your search

+7 -5
View File
@@ -38,7 +38,9 @@ const ApprovalPermissionPage = lazy(() => import('@/pages/ApprovalPermissionPage
const ApprovalWorkflowPage = lazy(() => import('@/pages/ApprovalWorkflowPage').then(m => ({ default: m.default })));
const ScriptManager = lazy(() => import('@/components/automation/ScriptManager').then(m => ({ default: m.ScriptManager })));
const SystemManager = lazy(() => import('@/components/system/SystemManager').then(m => ({ default: m.SystemManager })));
const AuditPage = lazy(() => import('@/pages/AuditPage').then(m => ({ default: m.AuditPage })));
const TerminalAuditTab = lazy(() => import('@/pages/TerminalAuditTab').then(m => ({ default: m.TerminalAuditTab })));
const AuditOperationsTab = lazy(() => import('@/pages/AuditOperationsTab').then(m => ({ default: m.AuditOperationsTab })));
const LoginLogsTab = lazy(() => import('@/pages/LoginLogsTab').then(m => ({ default: m.LoginLogsTab })));
const CredentialManager = lazy(() => import('@/components/deploy/CredentialManager').then(m => ({ default: m.default })));
const PipelineManager = lazy(() => import('@/components/deploy/PipelineManager').then(m => ({ default: m.PipelineManager })));
const DeployCredentials = lazy(() => import('@/components/deploy/DeployCredentials').then(m => ({ default: m.default })));
@@ -190,10 +192,10 @@ function App() {
<Route path="ai-alert-analyzer" element={<LazyPage><AIAlertAnalyzer /></LazyPage>} />
<Route path="ai-predictive" element={<LazyPage><AIPredictiveAnalytics /></LazyPage>} />
{/* Audit */}
<Route path="audit/terminal" element={<LazyPage><AuditPage /></LazyPage>} />
<Route path="audit/operations" element={<LazyPage><AuditPage /></LazyPage>} />
<Route path="audit/login-logs" element={<LazyPage><AuditPage /></LazyPage>} />
{/* Audit — 各 Tab 独立路由,支持 URL 直链 // Logan.Li */}
<Route path="audit/terminal" element={<LazyPage><TerminalAuditTab /></LazyPage>} />
<Route path="audit/operations" element={<LazyPage><AuditOperationsTab /></LazyPage>} />
<Route path="audit/login-logs" element={<LazyPage><LoginLogsTab /></LazyPage>} />
{/* System */}
<Route path="users" element={<LazyPage><SystemManager /></LazyPage>} />