This commit is contained in:
bietiaop 2024-07-08 22:17:31 +08:00
parent 0c72964b12
commit 51fb65cdb4
11 changed files with 313 additions and 56 deletions

View file

@ -11,7 +11,7 @@ export default class ZZZApiTool {
*/
constructor(uid, server) {
this.uid = uid;
this.isSr = true;
this.isZZZ = true;
this.server = server;
this.game = 'zzz';
this.uuid = crypto.randomUUID();
@ -19,18 +19,18 @@ export default class ZZZApiTool {
getUrlMap = (data = {}) => {
let host, hostRecord, hostPublicData;
if (['prod_gf_cn', 'prod_qd_cn'].includes(this.server)) {
if (['prod_gf_cn'].includes(this.server)) {
host = 'https://api-takumi.mihoyo.com/';
hostRecord = 'https://api-takumi-record.mihoyo.com/';
hostPublicData = 'https://public-data-api.mihoyo.com/';
} else if (/official/.test(this.server)) {
} else if (/prod_gf_/.test(this.server)) {
host = 'https://sg-public-api.hoyolab.com/';
hostRecord = 'https://bbs-api-os.hoyolab.com/';
hostPublicData = 'https://sg-public-data-api.hoyoverse.com/';
}
let urlMap = {
zzz: {
...(['prod_gf_cn', 'prod_qd_cn'].includes(this.server)
...(['prod_gf_cn'].includes(this.server)
? {
zzzUser: {
url: `${host}binding/api/getUserGameRolesByCookie`,
@ -78,6 +78,16 @@ export default class ZZZApiTool {
url: `${hostRecord}event/game_record_zzz/api/zzz/index`,
query: `role_id=${this.uid}&server=${this.server}`,
},
zzzAuthKey: {
url: `${host}binding/api/genAuthKey`,
body: {
auth_appid: 'webview_gacha',
game_biz: 'nap_cn',
game_uid: this.uid * 1,
region: this.server,
},
dsSalt: 'web',
},
},
};
return urlMap[this.game];