From 832902b23972a1a225b394b525e2ba1f28fc3aa3 Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Mon, 23 Oct 2023 11:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3miaoApi=E4=B8=8B=E6=98=9F?= =?UTF-8?q?=E9=93=81=E9=9D=A2=E6=9D=BF=E6=B8=B8=E6=88=8F=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/Player.js | 2 +- models/serv/ProfileReq.js | 4 ++-- models/serv/ProfileServ.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/models/Player.js b/models/Player.js index 1dc0e8d5..9b98c1f8 100644 --- a/models/Player.js +++ b/models/Player.js @@ -228,7 +228,7 @@ export default class Player extends Base { async forEachAvatar (fn) { for (let id in this._avatars) { let avatar = this.getAvatar(id) - if (avatar && avatar.hasData) { + if (avatar && avatar.hasData && avatar.game === this.game) { let ret = fn(avatar, id) ret = Data.isPromise(ret) ? await ret : ret if (ret === false) { diff --git a/models/serv/ProfileReq.js b/models/serv/ProfileReq.js index 3b9b65ce..1249b96c 100644 --- a/models/serv/ProfileReq.js +++ b/models/serv/ProfileReq.js @@ -69,7 +69,7 @@ export default class ProfileReq extends Base { let self = this this.serv = serv let uid = this.uid - let reqParam = await serv.getReqParam(uid, self.game) + let reqParam = await serv.getReqParam(uid, player.game) let cdTime = await this.inCd() if (cdTime && !process.argv.includes('web-debug')) { // return this.err(`请求过快,请${cdTime}秒后重试..`) @@ -109,7 +109,7 @@ export default class ProfileReq extends Base { self._isReq = false data = {} } - data = await serv.response(data, this, self.game) + data = await serv.response(data, this, player.game) // 设置CD cdTime = serv.getCdTime(data) if (cdTime) { diff --git a/models/serv/ProfileServ.js b/models/serv/ProfileServ.js index 92834cd8..451c24ea 100644 --- a/models/serv/ProfileServ.js +++ b/models/serv/ProfileServ.js @@ -36,6 +36,7 @@ export default class ProfileServ extends Base { let url = this.getCfg('url') let profileApi = this.getCfg('listApi') let cfg = this._cfg + let api = profileApi({ url, uid: uid,