From ef4c048a2e7e47a10d9440c7935611c2de246410 Mon Sep 17 00:00:00 2001 From: TomyJan Date: Mon, 11 Dec 2023 18:25:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8E=9F=E7=A5=9E=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ components/MysApi.js | 12 ++++++------ model/mys/mihoyoApi.js | 10 ++++++++-- model/mys/mysTool.js | 8 ++++---- 4 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..313cc62 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# 用户数据 +data/ diff --git a/components/MysApi.js b/components/MysApi.js index 721cb90..05332e8 100644 --- a/components/MysApi.js +++ b/components/MysApi.js @@ -42,16 +42,16 @@ let MysApi = { query = `uid=${uid}`;//米游社id break; case "bbs_sign_info": - url += "/event/bbs_sign_reward/info"; - query = `act_id=e202009291139501®ion=${server}&uid=${uid}`; + url += "/event/luna/info"; + query = `act_id=e202311201442471®ion=${server}&uid=${uid}`; break; case "bbs_sign_home": - url += "/event/bbs_sign_reward/home"; - query = `act_id=e202009291139501®ion=${server}&uid=${uid}`; + url += "/event/luna/home"; + query = `act_id=e202311201442471®ion=${server}&uid=${uid}`; break; case "bbs_sign": - url += "/event/bbs_sign_reward/sign"; - body = JSON.stringify({ act_id: "e202009291139501", region: server, uid: uid, }); + url += "/event/luna/sign"; + body = JSON.stringify({ act_id: "e202311201442471", region: server, uid: uid, }); break; case "ys_ledger": url = "https://hk4e-api.mihoyo.com/event/ys_ledger/monthInfo"; diff --git a/model/mys/mihoyoApi.js b/model/mys/mihoyoApi.js index 1b9ffb4..030a0e3 100644 --- a/model/mys/mihoyoApi.js +++ b/model/mys/mihoyoApi.js @@ -371,7 +371,6 @@ export default class miHoYoApi { 'accept-language': 'zh-CN,zh;q=0.9,ja-JP;q=0.8,ja;q=0.7,en-US;q=0.6,en;q=0.5', 'x-rpc-device_id': DEVICE_ID, 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) miHoYoBBS/${mys.APP_VERSION}`, - Referer: board.getReferer(), Host: 'api-takumi.mihoyo.com', 'x-rpc-channel': 'appstore', 'x-rpc-app_version': mys.APP_VERSION, @@ -379,7 +378,14 @@ export default class miHoYoApi { 'x-rpc-client_type': '5', 'Content-Type': 'application/json;charset=UTF-8', DS: this.getDs(), - 'Cookie': this.cookie + 'Cookie': this.cookie, + ...(board.key === 'genshin'? { + 'x-rpc-signgame': 'hk4e', + 'Origin': 'htps://act.mihoyo.com', + 'Referer': 'https://act.mihoyo.com/', + } : { + Referer: board.getReferer(), + }) } if (this.isOs) { let os_Header = { diff --git a/model/mys/mysTool.js b/model/mys/mysTool.js index 5073458..ce14318 100644 --- a/model/mys/mysTool.js +++ b/model/mys/mysTool.js @@ -68,7 +68,7 @@ const boards = { key: 'genshin', biz: 'hk4e_cn', osbiz: 'hk4e_global', - actid: 'e202009291139501', + actid: 'e202311201442471', name: '原神', url: "https://bbs.mihoyo.com/ys/", signUrl(data, type, api) { @@ -76,13 +76,13 @@ const boards = { switch (type) { case "isSign": dataUrl = { - url: `${api}/event/bbs_sign_reward/info`, + url: `${api}/event/luna/info`, query: `region=${data.region}&act_id=${this.actid}&uid=${data.game_uid}` } break; case "sign": dataUrl = { - url: `${api}/event/bbs_sign_reward/sign`, + url: `${api}/event/luna/sign`, body: { region: data.region, act_id: this.actid, @@ -92,7 +92,7 @@ const boards = { break; case "home": dataUrl = { - url: `${api}/event/bbs_sign_reward/home`, + url: `${api}/event/luna/home`, query: `act_id=${this.actid}` } break;