feat:国际服 抽卡链接 & 抽卡分析

This commit is contained in:
kissnavel 2025-08-24 22:04:28 +08:00
parent 607b85c922
commit 6c475878a7
4 changed files with 33 additions and 28 deletions

View file

@ -25,7 +25,7 @@ import { getZZZGachaLogByAuthkey } from './gacha/core.js';
* }
* }>} 更新后的抽卡数据
*/
export const updateGachaLog = async (authKey, uid) => {
export const updateGachaLog = async (authKey, uid, region, game_biz) => {
// 获取之前的抽卡数据
let previousLog = getGachaLog(uid);
if (!previousLog) {
@ -61,7 +61,9 @@ export const updateGachaLog = async (authKey, uid) => {
type,
type[0],
page,
endId
endId,
region,
game_biz
);
if (!log || !log?.list || log?.list?.length === 0) {
break;

View file

@ -1,4 +1,4 @@
import { ZZZ_GET_GACHA_LOG_API } from '../mysapi/api.js';
import { ZZZ_GET_GACHA_LOG_API, ZZZ_GET_GACHA_OS_LOG_API } from '../mysapi/api.js';
import request from '../../utils/request.js';
import { ZZZGachaLogResp } from '../../model/gacha.js';
@ -18,11 +18,12 @@ export const getZZZGachaLink = async (
initLogGachaBaseType = '2',
page = 1,
endId = '0',
size = '20'
serverId,
game_biz
) => {
// 暂时直接写死服务器为国服
const serverId = 'prod_gf_cn';
const url = ZZZ_GET_GACHA_LOG_API;
const region = serverId || 'prod_gf_cn'
const gamebiz = game_biz || 'nap_cn'
const url = gamebiz == 'nap_global' ? ZZZ_GET_GACHA_OS_LOG_API : ZZZ_GET_GACHA_LOG_API
const timestamp = Math.floor(Date.now() / 1000);
// 请求参数
const params = new URLSearchParams({
@ -36,13 +37,13 @@ export const getZZZGachaLink = async (
lang: 'zh-cn',
device_type: 'mobile',
plat_type: 'ios',
region: serverId,
region: region,
authkey: authKey,
game_biz: 'nap_cn',
game_biz: gamebiz,
gacha_type: gachaType,
real_gacha_type: initLogGachaBaseType,
page: page,
size: size,
size: '20',
end_id: endId,
});
// 完整链接
@ -63,7 +64,9 @@ export const getZZZGachaLogByAuthkey = async (
gachaType = '2001',
initLogGachaBaseType = '2',
page = 1,
endId = '0'
endId = '0',
region,
game_biz
) => {
// 获取抽卡链接
const link = await getZZZGachaLink(
@ -71,7 +74,9 @@ export const getZZZGachaLogByAuthkey = async (
gachaType,
initLogGachaBaseType,
page,
endId
endId,
region,
game_biz
);
// 发送请求
const response = await request(link, {

View file

@ -14,3 +14,7 @@ export const ZZZ_API = `${NEW_URL}/event/game_record_zzz/api/zzz`,
export const PUBLIC_API = 'https://public-operation-nap.mihoyo.com',
PUBILC_GACHA_LOG_API = `${PUBLIC_API}/common/gacha_record/api`,
ZZZ_GET_GACHA_LOG_API = `${PUBILC_GACHA_LOG_API}/getGachaLog`;
export const PUBLIC_OS_API = 'https://public-operation-nap-sg.hoyoverse.com',
PUBILC_GACHA_OS_LOG_API = `${PUBLIC_OS_API}/common/gacha_record/api`,
ZZZ_GET_GACHA_OS_LOG_API = `${PUBILC_GACHA_OS_LOG_API}/getGachaLog`;