From 4b7a03e7568702f0c61a180863a7cc88f1672d09 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 6 Jun 2023 11:29:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E7=A4=BC=E5=8C=85=E7=A0=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6):=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/mailService.ts | 3 ++- game-server/app/services/sdkService.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/game-server/app/services/mailService.ts b/game-server/app/services/mailService.ts index f73eba75c..dbc02ddd8 100644 --- a/game-server/app/services/mailService.ts +++ b/game-server/app/services/mailService.ts @@ -246,9 +246,10 @@ export class SendMailFun { // 生成单人邮件 public async createSingleMails(code: string, roleIds: string[]) { let mapTemp = this.mailTemps.get(code); + if(mapTemp) console.log('#### createSingleMails', mapTemp.getCreateMailParams()?.contentId, roleIds); if(mapTemp.sendTime < nowSeconds()) return; for(let roleId of roleIds) { - console.log('#### createSingleMails this.hideMail', this.hideMail, this.hideMail? MAIL_STATUS.HIDE: MAIL_STATUS.CREATE) + // console.log('#### createSingleMails this.hideMail', this.hideMail, this.hideMail? MAIL_STATUS.HIDE: MAIL_STATUS.CREATE) let originMail = await MailModel.addMail({ roleId, status: this.hideMail? MAIL_STATUS.HIDE: MAIL_STATUS.CREATE, ...mapTemp.getCreateMailParams() }); this.mails.push(originMail); } diff --git a/game-server/app/services/sdkService.ts b/game-server/app/services/sdkService.ts index a840d07e4..858022363 100644 --- a/game-server/app/services/sdkService.ts +++ b/game-server/app/services/sdkService.ts @@ -327,15 +327,17 @@ export async function sendSurveyMail(code: string) { } export async function sendGiftCodeMail(message: string) { - console.log('***** sendSurveyMail', message); + console.log('***** sendGiftCodeMail 1', message); let [roleId, _giftId] = message.split('|'); let giftId = parseInt(_giftId); + console.log('****** sendGiftCodeMail 2', roleId, giftId, isNaN(giftId)) if(isNaN(giftId) || !roleId) return false; let giftCode = await GiftCodeModel.findByGiftId(giftId); if(!giftCode) { - console.log('***** sendSurveyMail giftId not found', giftId); + console.log('***** sendGiftCodeMail giftId not found', giftId); return false; } + console.log('****** sendGiftCodeMail 3', roleId, giftCode.goods); await sendMailByContent(MAIL_TYPE.SEND_MAIL, roleId, { goods: giftCode.goods, params: ['尊敬的百家传人,附件为您在平台活动获得的奖励,请查收!'] }); } \ No newline at end of file