|
@@ -40,6 +40,7 @@ const GAMES = {
|
|
|
Baselist: {},
|
|
Baselist: {},
|
|
|
Relations: {},
|
|
Relations: {},
|
|
|
Solutions: {},
|
|
Solutions: {},
|
|
|
|
|
+ UpdateTimestamp: {},
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const Request = {
|
|
const Request = {
|
|
@@ -114,7 +115,7 @@ const updateLeaguesList = ({ mk, leagues }) => {
|
|
|
* 获取筛选过的联赛
|
|
* 获取筛选过的联赛
|
|
|
*/
|
|
*/
|
|
|
const getFilteredLeagues = async (mk) => {
|
|
const getFilteredLeagues = async (mk) => {
|
|
|
- return axios.get(`${BASE_API_URL}/p/getLeagueTast?mk=${mk}`, { proxy: false })
|
|
|
|
|
|
|
+ return axios.get(`${BASE_API_URL}/p/getLeagueTast?mk=${mk ?? ''}`, { proxy: false })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
@@ -345,12 +346,21 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const updateGamesEvents = ({ platform, mk, games, outrights }) => {
|
|
|
|
|
|
|
+const updateGamesEvents = ({ platform, mk, games, outrights, timestamp, tp }) => {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
if (!platform || (!games && !outrights)) {
|
|
if (!platform || (!games && !outrights)) {
|
|
|
return reject(new Error('PLATFORM_GAMES_INVALID'));
|
|
return reject(new Error('PLATFORM_GAMES_INVALID'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const { UpdateTimestamp } = GAMES;
|
|
|
|
|
+ if (!UpdateTimestamp[tp] || UpdateTimestamp[tp] < timestamp) {
|
|
|
|
|
+ // Logs.out('updateGamesEvents', { tp, timestamp });
|
|
|
|
|
+ UpdateTimestamp[tp] = timestamp;
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return resolve({ update: 0 });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (platform == 'ps') {
|
|
if (platform == 'ps') {
|
|
|
const update = syncBaseEvents({ mk, games, outrights });
|
|
const update = syncBaseEvents({ mk, games, outrights });
|
|
|
return resolve({ update });
|
|
return resolve({ update });
|