소스 검색

移除测试文件

flyzto 4 주 전
부모
커밋
b8bc407898
1개의 변경된 파일4개의 추가작업 그리고 14개의 파일을 삭제
  1. 4 14
      server/models/GamesPs.js

+ 4 - 14
server/models/GamesPs.js

@@ -10,7 +10,6 @@ const fs = require('fs');
 const path = require('path');
 
 const GamesCacheFile = path.join(__dirname, '../data/games.cache');
-const DevGameTastFile = path.join(__dirname, '../data/gameTast.json');
 
 const childOptions = process.env.NODE_ENV == 'development' ? {
   execArgv: ['--inspect=9230'],
@@ -624,22 +623,13 @@ const getGamesEvents = ({ platform, relIds = [] } = {}) => {
 /**
  * 获取关联比赛
  */
-const getDevGameTast = () => {
-  return new Promise((resolve) => {
-    const data = Cache.getData(DevGameTastFile, true);
-    resolve({data});
-  });
-}
 const fetchGamesRelation = async (mk='') => {
-  const getGameTast = Promise.all([
-    getDevGameTast(),
-    axios.get(`${BASE_API_URL}/p/getGameTast?mk=${mk}`, { proxy: false })
-  ]);
-  return getGameTast.then(([res1, res2]) => {
-    const resData = res1.data ?? res2.data;
+  return axios.get(`${BASE_API_URL}/p/getGameTast?mk=${mk}`, {
+    proxy: false
+  }).then(({ data: resData }) => {
     if (resData.code == 0) {
       const nowTime = Date.now();
-      const gamesRelation = resData.data?.filter(item => {
+      const gamesRelation = resData.data?.filter?.((item) => {
         const timestamp = new Date(item.timestamp).getTime();
         if (nowTime > timestamp) {
           item.mk = 2;