From 3425eae56f7029b9572c1be42197756ba4ba6cb8 Mon Sep 17 00:00:00 2001 From: kissnavel Date: Fri, 12 Jul 2024 03:55:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E5=9B=BD=E9=99=85=E6=9C=8Dapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mysapi/tool.js | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/lib/mysapi/tool.js b/lib/mysapi/tool.js index 8c59ea2..6baecd0 100644 --- a/lib/mysapi/tool.js +++ b/lib/mysapi/tool.js @@ -21,7 +21,7 @@ export default class ZZZApiTool { this.hostPublicData = 'https://public-data-api.mihoyo.com/'; } else { this.host = 'https://sg-public-api.hoyolab.com/'; - this.hostRecord = 'https://bbs-api-os.hoyolab.com/'; + this.hostNap = 'https://sg-act-nap-api.hoyolab.com/'; this.hostPublicData = 'https://sg-public-data-api.hoyoverse.com/'; } this.zzzUrlMap = { @@ -102,24 +102,19 @@ export default class ZZZApiTool { }; if (/_us|_eu|_jp|_sg/.test(this.server)) { - urlMap.zzz.zzzNote.url = - 'https://sg-act-nap-api.hoyolab.com/event/game_record_zzz/api/zzz/note'; + urlMap.zzz.zzzUser.url = `${this.host}binding/api/getUserGameRolesByCookie`; + urlMap.zzz.zzzUser.query = `game_biz=nap_global®ion=${this.server}&game_uid=${this.uid}`; + urlMap.zzz.zzzNote.url = `${this.hostNap}event/game_record_zzz/api/zzz/note`; urlMap.zzz.zzzNote.query = `role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzIndex.url = - 'https://sg-act-nap-api.hoyolab.com/event/game_record_zzz/api/zzz/index'; + urlMap.zzz.zzzIndex.url = `${this.hostNap}event/game_record_zzz/api/zzz/index`; urlMap.zzz.zzzIndex.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzAvatarList.url = - 'https://sg-act-nap-api.hoyolab.com/event/game_record_zzz/api/zzz/avatar/basic'; - urlMap.zzz.zzzAvatarList.query = `role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzAvatarInfo.url = - 'https://sg-act-nap-api.hoyolab.com/event/game_record_zzz/api/zzz/avatar/info'; - urlMap.zzz.zzzAvatarInfo.query = `role_id=${this.uid}&server=${this.server}&need_wiki=false`; - urlMap.zzz.zzzBuddyList.url = - 'https://sg-act-nap-api.hoyolab.com/event/game_record_zzz/api/zzz/buddy/info'; + urlMap.zzz.zzzAvatarList.url = `${this.hostNap}event/game_record_zzz/api/zzz/avatar/basic`; + urlMap.zzz.zzzAvatarList.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; + urlMap.zzz.zzzAvatarInfo.url = `${this.hostNap}event/game_record_zzz/api/zzz/avatar/info`; + urlMap.zzz.zzzAvatarInfo.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}&need_wiki=false`; + urlMap.zzz.zzzBuddyList.url = `${this.hostNap}event/game_record_zzz/api/zzz/buddy/info`; urlMap.zzz.zzzBuddyList.query = `role_id=${this.uid}&server=${this.server}`; - urlMap.zzzUser.url = `${this.host}binding/api/getUserGameRolesByCookie`; - urlMap.zzzUser.query = `game_biz=nap_global®ion=${this.server}&game_uid=${this.uid}`; } return urlMap[this.game]; }; -} +} \ No newline at end of file From 0603129ae0e9299e2302e55c25e7ac6da1c71756 Mon Sep 17 00:00:00 2001 From: kissnavel Date: Fri, 12 Jul 2024 04:02:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=82=A6=E5=B8=83=E5=A2=9E=E5=8A=A0lang?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mysapi/tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysapi/tool.js b/lib/mysapi/tool.js index 6baecd0..e63faf7 100644 --- a/lib/mysapi/tool.js +++ b/lib/mysapi/tool.js @@ -113,7 +113,7 @@ export default class ZZZApiTool { urlMap.zzz.zzzAvatarInfo.url = `${this.hostNap}event/game_record_zzz/api/zzz/avatar/info`; urlMap.zzz.zzzAvatarInfo.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}&need_wiki=false`; urlMap.zzz.zzzBuddyList.url = `${this.hostNap}event/game_record_zzz/api/zzz/buddy/info`; - urlMap.zzz.zzzBuddyList.query = `role_id=${this.uid}&server=${this.server}`; + urlMap.zzz.zzzBuddyList.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; } return urlMap[this.game]; }; From e1dbba67926d644e2812c8b9ee748f58a52b2184 Mon Sep 17 00:00:00 2001 From: kissnavel Date: Fri, 12 Jul 2024 04:40:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=E7=BB=9F=E4=B8=80=E5=9B=BD=E6=9C=8D?= =?UTF-8?q?=E4=B8=8E=E5=9B=BD=E9=99=85=E6=9C=8DurlMap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mysapi/tool.js | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/lib/mysapi/tool.js b/lib/mysapi/tool.js index e63faf7..511e13e 100644 --- a/lib/mysapi/tool.js +++ b/lib/mysapi/tool.js @@ -21,33 +21,29 @@ export default class ZZZApiTool { this.hostPublicData = 'https://public-data-api.mihoyo.com/'; } else { this.host = 'https://sg-public-api.hoyolab.com/'; - this.hostNap = 'https://sg-act-nap-api.hoyolab.com/'; + this.hostRecord = 'https://sg-act-nap-api.hoyolab.com/'; this.hostPublicData = 'https://sg-public-data-api.hoyoverse.com/'; } this.zzzUrlMap = { - zzzUser: { - url: `${this.host}binding/api/getUserGameRolesByCookie`, - query: `game_biz=nap_cn®ion=${this.server}&game_uid=${this.uid}`, - }, zzzNote: { url: `${this.hostRecord}event/game_record_zzz/api/zzz/note`, query: `role_id=${this.uid}&server=${this.server}`, }, zzzIndex: { url: `${this.hostRecord}event/game_record_zzz/api/zzz/index`, - query: `role_id=${this.uid}&server=${this.server}`, + query: `lang=zh-cn&role_id=${this.uid}&server=${this.server}`, }, zzzAvatarList: { url: `${this.hostRecord}event/game_record_zzz/api/zzz/avatar/basic`, - query: `role_id=${this.uid}&server=${this.server}`, + query: `lang=zh-cn&role_id=${this.uid}&server=${this.server}`, }, zzzAvatarInfo: { url: `${this.hostRecord}event/game_record_zzz/api/zzz/avatar/info`, - query: `role_id=${this.uid}&server=${this.server}&need_wiki=false`, + query: `lang=zh-cn&role_id=${this.uid}&server=${this.server}&need_wiki=false`, }, zzzBuddyList: { url: `${this.hostRecord}event/game_record_zzz/api/zzz/buddy/info`, - query: `role_id=${this.uid}&server=${this.server}`, + query: `lang=zh-cn&role_id=${this.uid}&server=${this.server}`, }, zzzAuthKey: { url: `${this.host}binding/api/genAuthKey`, @@ -67,6 +63,10 @@ export default class ZZZApiTool { zzz: { ...(['prod_gf_cn'].includes(this.server) ? { + zzzUser: { + url: `${this.host}binding/api/getUserGameRolesByCookie`, + query: `game_biz=nap_cn®ion=${this.server}&game_uid=${this.uid}`, + }, getFp: { url: `${this.hostPublicData}device-fp/api/getFp`, body: { @@ -82,6 +82,10 @@ export default class ZZZApiTool { }, } : { + zzzUser: { + url: `${this.host}binding/api/getUserGameRolesByCookie`, + query: `game_biz=nap_cn®ion=${this.server}&game_uid=${this.uid}`, + }, getFp: { url: `${this.hostPublicData}device-fp/api/getFp`, body: { @@ -100,21 +104,6 @@ export default class ZZZApiTool { ...this.zzzUrlMap, }, }; - - if (/_us|_eu|_jp|_sg/.test(this.server)) { - urlMap.zzz.zzzUser.url = `${this.host}binding/api/getUserGameRolesByCookie`; - urlMap.zzz.zzzUser.query = `game_biz=nap_global®ion=${this.server}&game_uid=${this.uid}`; - urlMap.zzz.zzzNote.url = `${this.hostNap}event/game_record_zzz/api/zzz/note`; - urlMap.zzz.zzzNote.query = `role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzIndex.url = `${this.hostNap}event/game_record_zzz/api/zzz/index`; - urlMap.zzz.zzzIndex.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzAvatarList.url = `${this.hostNap}event/game_record_zzz/api/zzz/avatar/basic`; - urlMap.zzz.zzzAvatarList.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; - urlMap.zzz.zzzAvatarInfo.url = `${this.hostNap}event/game_record_zzz/api/zzz/avatar/info`; - urlMap.zzz.zzzAvatarInfo.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}&need_wiki=false`; - urlMap.zzz.zzzBuddyList.url = `${this.hostNap}event/game_record_zzz/api/zzz/buddy/info`; - urlMap.zzz.zzzBuddyList.query = `lang=zh-cn&role_id=${this.uid}&server=${this.server}`; - } return urlMap[this.game]; }; } \ No newline at end of file From 0b0450b3d40edb16058a5e84373a276832dfd50b Mon Sep 17 00:00:00 2001 From: kissnavel Date: Fri, 12 Jul 2024 04:44:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=E5=9B=BD=E9=99=85=E6=9C=8DzzzUser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mysapi/tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysapi/tool.js b/lib/mysapi/tool.js index 511e13e..39e43a7 100644 --- a/lib/mysapi/tool.js +++ b/lib/mysapi/tool.js @@ -84,7 +84,7 @@ export default class ZZZApiTool { : { zzzUser: { url: `${this.host}binding/api/getUserGameRolesByCookie`, - query: `game_biz=nap_cn®ion=${this.server}&game_uid=${this.uid}`, + query: `game_biz=nap_global®ion=${this.server}&game_uid=${this.uid}`, }, getFp: { url: `${this.hostPublicData}device-fp/api/getFp`,