Просмотр исходного кода

在client/mobile/mobile_app.tsx中添加股票路由

yourname 6 месяцев назад
Родитель
Сommit
fce38c1f28
2 измененных файлов с 7 добавлено и 1 удалено
  1. 6 0
      client/mobile/mobile_app.tsx
  2. 1 1
      server/app.tsx

+ 6 - 0
client/mobile/mobile_app.tsx

@@ -17,6 +17,7 @@ import { AuthProvider, ThemeProvider, useAuth } from './hooks.tsx';
 import HomePage from './pages_index.tsx';
 import LoginPage from './pages_login.tsx';
 import RegisterPage from './pages_register.tsx';
+import { StockMain } from './components/stock/stock_main.tsx';
 import { GlobalConfig } from "../share/types.ts";
 import { ExclamationTriangleIcon, HomeIcon, BellIcon, UserIcon, AcademicCapIcon } from '@heroicons/react/24/outline';
 import { NotificationsPage } from './pages_messages.tsx';
@@ -280,6 +281,11 @@ const App = () => {
       element: <ProtectedRoute><ClassroomPage /></ProtectedRoute>,
       errorElement: <ErrorPage />
     },
+    {
+      path: '/mobile/stock',
+      element: <ProtectedRoute><StockMain /></ProtectedRoute>,
+      errorElement: <ErrorPage />
+    },
     {
       path: '/mobile/exam',
       element: <ProtectedRoute><ExamIndex /></ProtectedRoute>,

+ 1 - 1
server/app.tsx

@@ -122,7 +122,7 @@ export default function({ apiClient, app, moduleDir , auth}: ModuleParams) {
 
                 {/* 股票训练入口按钮 */}
                 <a
-                  href="/stock"
+                  href="/mobile/stock"
                   className="w-full flex justify-center py-3 px-4 border border-blue-600 rounded-md shadow-sm text-lg font-medium text-blue-600 bg-white hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
                 >
                   进入股票训练