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,