From 748da2a3e9a0c4068196a79bd0c82184cfd8c924 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Thu, 11 Jan 2024 20:49:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E7=9A=AE=E8=82=A4=E6=8F=90=E4=BE=9B=E7=9A=84=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/user/ApiChangeInfo.ts | 3 ++- src/shared/public/user.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index 5bfac14..2bc00b3 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -20,7 +20,8 @@ export default async function (call: ApiCall) { vip: call.conn.gud.vip, lsyx: call.conn.lshd.hero, model: call.conn.gud.model, - active: active + active: active, + heroskin: call.conn.gud.heroskin }); if (!isMeet && call.req.type != 'headFrame' && call.req.type != 'chatFrame') return call.error(globalThis.lng.user_1); diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index fe19f59..87e7ba8 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -24,7 +24,7 @@ export class UserShared { * 判断头像之类是否激活 * @param id 请使用 UserShared.getInfo 转化后的id */ - static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, model: k_v, active: k_v; }>) { + static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, model: k_v, active: k_v, heroskin: k_v; }>) { const [type, id] = fmtId.split('_'); const jsonName = 'player' + type.slice(0, 1).toLocaleUpperCase() + type.slice(1); @@ -37,6 +37,7 @@ export class UserShared { // else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active?.[fmtId] > G.time; else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]); + else if (conf.cond[0] == 'heroskin') return collection.heroskin[conf.cond[1]]; else return false; } } \ No newline at end of file From 9484a696b38c00def131471967580996f3cfc610 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Thu, 11 Jan 2024 21:05:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E6=96=B0=E5=A2=9E=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/public/user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 87e7ba8..5310bab 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -37,7 +37,7 @@ export class UserShared { // else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active?.[fmtId] > G.time; else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]); - else if (conf.cond[0] == 'heroskin') return collection.heroskin[conf.cond[1]]; + else if (conf.cond[0] == 'heroskin') return conf.cond[1] in collection.heroskin; else return false; } } \ No newline at end of file