Files
jeffusion 0b5cbfd5ba feat(frontend): add react-router and refactor app routing
Migrate to react-router-dom for SPA routing:
- Add BrowserRouter with nested routes
- Implement AuthGuard component for protected routes
- Add collapsible sidebar navigation
- Support /repos and /config routes

Changes:
- App.tsx: Route definitions with AuthGuard wrapper
- main.tsx: Force dark mode, improved retry logic
- DashboardPage.tsx: New layout with sidebar + Outlet
- vite.config.ts: Expose dev server on 0.0.0.0

Dependencies added:
- react-router-dom
- @radix-ui/react-select, switch, separator, tabs
2026-03-03 16:32:40 +08:00

24 lines
505 B
TypeScript

import path from "path"
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
host: '0.0.0.0',
proxy: {
// 将 /admin/api 的请求代理到后端服务
'/admin/api': {
target: 'http://localhost:5174', // 后端服务地址
changeOrigin: true,
},
},
},
})