瀏覽代碼

修正socket_token

yourname 6 月之前
父節點
當前提交
f8011fe368

+ 4 - 1
client/mobile/components/Exam/hooks/useSocketClient.ts

@@ -88,7 +88,10 @@ export function useSocketClient(roomId: string | null) {
       const newSocket = io('/', {
         path: '/socket.io',
         transports: ['websocket'],
-        query: { token },
+        withCredentials: true,
+        query: {
+          socket_token: token
+        },
         reconnection: true,
         reconnectionAttempts: 5,
         reconnectionDelay: 1000,

+ 4 - 1
client/mobile/components/stock/hooks/useStockSocketClient.ts

@@ -31,7 +31,10 @@ export function useStockSocket(): StockSocketClient {
     const newSocket = io('/', {
       path: '/socket.io',
       transports: ['websocket'],
-      query: { token },
+      withCredentials: true,
+      query: { 
+        socket_token:token
+      },
       reconnection: true,
       reconnectionAttempts: 5,
       reconnectionDelay: 1000,

+ 1 - 1
client/mobile/components/stock/stock_main.tsx

@@ -173,7 +173,7 @@ export function StockMain() {
     <div className="flex flex-col h-screen bg-gray-900">
       {!isConnected && (
         <div className="bg-yellow-600 text-white text-center py-1 text-sm">
-          正在尝试连接行情服务...
+          正在尝试连接答题卡服务...
         </div>
       )}
       {/* 顶部行情和收益信息 */}