海口龙华志愿者后端管理页面
zhouxiantao
8 days ago 4def10e6567cf651ae333a2a65c497e717c06403
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React from 'react';
import { HashRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import { useSelector } from 'react-redux';
import Login from './pages/Login';
import Layout from './components/Layout';
import Dashboard from './pages/Dashboard';
import PointTypeManagement from './pages/points/PointTypeManagement';
import PointProjectManagement from './pages/points/PointProjectManagement';
import DeclarationRuleManagement from './pages/points/DeclarationRuleManagement';
import ActivityList from './pages/activity/ActivityList';
import ActivityCreate from './pages/activity/ActivityCreate';
import ActivityEdit from './pages/activity/ActivityEdit';
import RegistrationManagement from './pages/activity/RegistrationManagement';
import RegistrationDetail from './pages/activity/RegistrationDetail';
import VolunteerList from './pages/volunteer/VolunteerList';
import VolunteerPoints from './pages/volunteer/VolunteerPoints';
import VolunteerDetail from './pages/volunteer/VolunteerDetail';
import StatisticsOverview from './pages/statistics/StatisticsOverview';
import StatisticsTrends from './pages/statistics/StatisticsTrends';
import ReportCenter from './pages/statistics/ReportCenter';
import UserManagement from './pages/system/UserManagement';
import AdminManagement from './pages/system/AdminManagement';
import PermissionManagement from './pages/system/PermissionManagement';
import SystemSettings from './pages/system/SystemSettings';
 
function App() {
  const { isAuthenticated } = useSelector((state) => state.auth);
 
  if (!isAuthenticated) {
    return (
      <Router>
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="*" element={<Navigate to="/login" replace />} />
        </Routes>
      </Router>
    );
  }
 
  return (
    <Router>
      <Layout>
        <Routes>
          <Route path="/" element={<Navigate to="/dashboard" replace />} />
          <Route path="/dashboard" element={<Dashboard />} />
          
          {/* 积分管理 */}
          {/* <Route path="/points/types" element={<PointTypeManagement />} />
          <Route path="/points/projects" element={<PointProjectManagement />} /> */}
          <Route path="/points/rules" element={<DeclarationRuleManagement />} />
          
          {/* 活动管理 */}
          <Route path="/activities" element={<ActivityList />} />
          <Route path="/activities/create" element={<ActivityCreate />} />
          <Route path="/activities/edit/:id" element={<ActivityEdit />} />
          <Route path="/activities/registrations/:id" element={<RegistrationManagement />} />
          <Route path="/activities/registrations/detail/:id" element={<RegistrationDetail />} />
          
          {/* 志愿者管理 */}
          <Route path="/volunteers" element={<VolunteerList />} />
          <Route path="/volunteers/points" element={<VolunteerPoints />} />
          <Route path="/volunteers/:id" element={<VolunteerDetail />} />
          
          {/* 统计分析 */}
          <Route path="/statistics/overview" element={<StatisticsOverview />} />
          <Route path="/statistics/trends" element={<StatisticsTrends />} />
          <Route path="/statistics/reports" element={<ReportCenter />} />
          
          {/* 系统设置 */}
          <Route path="/system/admins" element={<AdminManagement />} />
          <Route path="/system/users" element={<UserManagement />} />
          <Route path="/system/permissions" element={<PermissionManagement />} />
          <Route path="/system/settings" element={<SystemSettings />} />
          
          <Route path="*" element={<Navigate to="/dashboard" replace />} />
        </Routes>
      </Layout>
    </Router>
  );
}
 
export default App;