flyzto há 6 meses atrás
pai
commit
b514075e2c

+ 8 - 5
server/models/Games.js

@@ -360,8 +360,11 @@ const solutionsCleanup = () => {
 }
 
 const getTotalProfit = (sid1, sid2, gold_side_jc) => {
-  const sol1 = GAMES.Solutions[sid1];
-  const sol2 = GAMES.Solutions[sid2];
+  const sol1 = GAMES.Solutions[sid1]?.sol;
+  const sol2 = GAMES.Solutions[sid2]?.sol;
+  if (!sol1 || !sol2 || !gold_side_jc) {
+    return {};
+  }
   return calcTotalProfit(sol1, sol2, gold_side_jc);
 }
 
@@ -379,9 +382,9 @@ events_child.on('message', async (message) => {
     if (type == 'getGamesRelation') {
       responseData = await getGamesRelation(true);
     }
-    else if (type == 'getSolutionHistory') {
-      responseData = getSolutionHistory();
-    }
+    // else if (type == 'getSolutionHistory') {
+    //   responseData = getSolutionHistory();
+    // }
     events_child.send({ type: 'response', id, data: responseData });
   }
   else if (method == 'post') {

+ 1 - 1
spider/index.js

@@ -87,7 +87,7 @@ const getGamesEvents = async () => {
 }
 
 const updateGamesList = ({ platform, games }) => {
-  axios.post('https://jc.long.bid/api/triangle/update_games_list', { platform, games }, { proxy: false })
+  axios.post('http://127.0.0.1:9055/api/triangle/update_games_list', { platform, games }, { proxy: false })
   .then(res => res.data)
   .then(ret => {
     if (ret.code) {

+ 1 - 1
web/apps/web-antd/.env.development

@@ -4,7 +4,7 @@ VITE_PORT=5666
 VITE_BASE=/
 
 # 接口地址
-VITE_GLOB_API_URL=https://jc.long.bid/api
+VITE_GLOB_API_URL=/api
 
 # 是否开启 Nitro Mock服务,true 为开启,false 为关闭
 VITE_NITRO_MOCK=false

+ 3 - 0
web/apps/web-antd/src/views/match/solutions/index.vue

@@ -213,6 +213,9 @@ const toggleSolution = (sid, timestamp) => {
   else {
     selectedSolutions.splice(1, 1, { sid, timestamp });
   }
+  if (selectedSolutions.length == 2) {
+    calcTotalProfit();
+  }
 }
 
 let updateTimer = null;

+ 1 - 1
web/apps/web-antd/vite.config.mts

@@ -15,7 +15,7 @@ export default defineConfig(async () => {
           '/api': {
             changeOrigin: true,
             rewrite: (path) => path.replace(/^\/api/, ''),
-            target: '/api',
+            target: 'http://127.0.0.1:9055/api',
             ws: true,
           },
         },