From 65ad5c203c2a164f18f972145b1bea63b0a23766 Mon Sep 17 00:00:00 2001 From: leiyilu <1509167646@qq.com> Date: Mon, 1 Aug 2022 14:02:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=B4=A92=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapter/index.js | 2 +- model/mys/mihoyo-api.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/adapter/index.js b/adapter/index.js index 44f5023..b285980 100644 --- a/adapter/index.js +++ b/adapter/index.js @@ -25,7 +25,7 @@ export class atlas extends plugin { e.getMysApi = async function (cfg) { return await getMysApi(e, cfg) } - msg = '#' + msg.replace('#', '') + msg = '#' + msg.replace(/#|#/, '').trim() for (let fn in Atlas.rule) { let cfg = Atlas.rule[fn] if (Atlas[fn] && new RegExp(cfg.reg).test(msg)) { diff --git a/model/mys/mihoyo-api.js b/model/mys/mihoyo-api.js index f34fbb4..beb01c5 100644 --- a/model/mys/mihoyo-api.js +++ b/model/mys/mihoyo-api.js @@ -113,11 +113,11 @@ export default class MihoYoApi { message: `未绑定${this.msgName}信息` } } - // // 获取签到信息和奖励信息 、、后续重新梳理补充 + // 获取签到信息和奖励信息 、、后续重新梳理补充 // const { // name, // count - // } = await this.getHonkai3rdSignInfo(game_uid, region, nickname, boards.honkai3rd) + // } = await this.getHonkai3rdSignInfo(objData.game_uid, objData.region, objData.nickname, boards.honkai3rd) // if (!name) { // return { // message: `获取签到信息和奖励信息异常` @@ -346,12 +346,19 @@ export default class MihoYoApi { } // 游戏签到操作 async postSign(board, game_uid, region) { + let web_api=`https://api-takumi.mihoyo.com` let url = - `https://api-takumi.mihoyo.com/common/eutheniav2/sign` + `${web_api}/common/eutheniav2/sign` if(board.name=="原神"){ - url=`https://api-takumi.mihoyo.com/event/bbs_sign_reward/sign` + url=`${web_api}/event/bbs_sign_reward/sign` + } + if(board.name=="崩坏2"||board.name=="未定事件簿"){ + url=`${web_api}/event/luna/info?lang=zh-cn` } url+=`?region=${region}&act_id=${board.actid}&uid=${game_uid}` + // if(board.name==="崩坏3"){ + // url=`https://webstatic.mihoyo.com/bh3/event/signin-cn/index.html?bbs_presentation_style=fullscreen&bbs_game_role_required=bh3_cn&bbs_auth_required=true&act_id=${board.actid}&utm_source=bbs&utm_medium=mys&utm_campaign=icon` + // } // console.log(url) // console.log(this.e) let res = await superagent.post(url).set(this.getpubHeaders(board)).timeout(10000);