From a2d16fb5309c1fda19320243f2ed9bb497f3a8aa Mon Sep 17 00:00:00 2001 From: xcy <871622040@qq.com> Date: Fri, 22 Dec 2023 16:15:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20email=20=E8=BF=87=E6=BB=A4=20prizeli?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/email/ApiOpen.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api_s2c/email/ApiOpen.ts b/src/api_s2c/email/ApiOpen.ts index ff711cf..7523532 100644 --- a/src/api_s2c/email/ApiOpen.ts +++ b/src/api_s2c/email/ApiOpen.ts @@ -3,11 +3,15 @@ import {EmailFun} from '../../public/email'; import {ReqOpen, ResOpen} from "../../shared/protocols/email/PtlOpen"; export default async function (call: ApiCall) { + // 存入当前玩家多语言信息 + await G.redis.rawSet(`user:lng:${call.uid}`, call.req.lng, {EX: 259200}) + let list = await EmailFun.getAllEmail(call.uid, false); let obj: ResOpen = {}; - list.forEach(e => obj[e._id] = e); - call.succ(obj); + for (let email of list) { + obj[email._id] = email; + if (email.prizelist) delete email.prizelist; + } - // 存入当前玩家多语言信息 - G.redis.rawSet(`user:lng:${call.uid}`, call.req.lng, {EX: 259200}) + call.succ(obj); } \ No newline at end of file From e269b1412a7aee26f2816dc0243338c8a78f1ba1 Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 22 Dec 2023 21:27:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/protocols/serviceProto.ts | 16 +++++++++++++++- src/shared/protocols/shop/PtlOpen.ts | 4 +--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 62ac7ca..bba26ab 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -19726,7 +19726,21 @@ export const serviceProto: ServiceProto = { "id": 2, "name": "t", "type": { - "type": "Number" + "type": "Union", + "members": [ + { + "id": 0, + "type": { + "type": "Number" + } + }, + { + "id": 1, + "type": { + "type": "String" + } + } + ] } }, { diff --git a/src/shared/protocols/shop/PtlOpen.ts b/src/shared/protocols/shop/PtlOpen.ts index 8ba4fc5..19341f9 100644 --- a/src/shared/protocols/shop/PtlOpen.ts +++ b/src/shared/protocols/shop/PtlOpen.ts @@ -1,5 +1,3 @@ - - /** * 商店open接口 */ @@ -32,7 +30,7 @@ export type shopItem = { /** 掉落类型 */ 'a': string; /** 掉落id */ - 't': number; + 't': number | string; /** 掉落数量 */ 'n': number; /** 权重 */