From d84c738a263bf23e86b4c955010f36e211ffad9e Mon Sep 17 00:00:00 2001 From: luying Date: Thu, 6 Apr 2023 09:57:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=B4=BB=E5=8A=A8):=20?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E5=85=B3=E6=B3=A8=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/activity/handler/bindPhoneHandler.ts | 4 +++- game-server/app/services/activity/bindPhoneService.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game-server/app/servers/activity/handler/bindPhoneHandler.ts b/game-server/app/servers/activity/handler/bindPhoneHandler.ts index 9915d938c..9d96b932b 100644 --- a/game-server/app/servers/activity/handler/bindPhoneHandler.ts +++ b/game-server/app/servers/activity/handler/bindPhoneHandler.ts @@ -1,6 +1,6 @@ import { Application, BackendSession, HandlerService } from 'pinus'; import { resResult } from '../../../pubUtils/util'; -import { BIND_PHONE_STATUS, ITEM_CHANGE_REASON, STATUS } from '../../../consts'; +import { BIND_PHONE_STATUS, ITEM_CHANGE_REASON, PUSH_ROUTE, SNS_LINK_TYPE, STATUS } from '../../../consts'; import { getPlayerDailyChallengesData } from '../../../services/activity/dailyChallengesService'; import { DailyItem } from '../../../domain/activityField/dailyChallengesField'; import { addReward, stringToRewardParam } from '../../../services/activity/giftPackageService'; @@ -10,6 +10,7 @@ import { getBindPhoneData, getAllSnsLinkDataShow, getPublicAccountData } from '. import { ActivityBindPhoneRewardModel } from '../../../db/ActivityBindPhoneReward'; import { ActivityPublicAccountCodeModel } from '../../../db/ActivityPublicAccountCode'; import { UserModel } from '../../../db/User'; +import { sendMessageToUserWithSuc } from '../../../services/pushService'; export default function (app: Application) { @@ -148,6 +149,7 @@ export class BindPhoneHandler { const uid = session.get('userid'); let user = await UserModel.findUserByUid(uid); await ActivityPublicAccountCodeModel.findOneAndUpdate({ activityId, channelId: user.channelId }, { $set: { serverId, roleId, orderId: 'test', hasReceived: false } }, { new: true, upsert: true }).lean(); + await sendMessageToUserWithSuc(roleId, PUSH_ROUTE.PUBLIC_ACCOUNT_GIFT, { activityId, type: SNS_LINK_TYPE.WX_PUBLIC_ACCOUNT, status: BIND_PHONE_STATUS.HAS_BIND }); return resResult(STATUS.SUCCESS); } diff --git a/game-server/app/services/activity/bindPhoneService.ts b/game-server/app/services/activity/bindPhoneService.ts index 94b5e5bb7..bcd0d50f8 100644 --- a/game-server/app/services/activity/bindPhoneService.ts +++ b/game-server/app/services/activity/bindPhoneService.ts @@ -142,6 +142,6 @@ export async function sendPublicAccountGift(message: string) { console.log('##### sendPublicAccountGift', message, userCode, onlineRoleId); if (!!onlineRoleId) { // 在线,推送消息 let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, channelId); - await sendMessageToUserWithSuc(onlineRoleId, PUSH_ROUTE.PUBLIC_ACCOUNT_GIFT, { activityId, type: SNS_LINK_TYPE.WX_PUBLIC_ACCOUNT, status: playerRecord.hasReceived? BIND_PHONE_STATUS.HAS_BIND: BIND_PHONE_STATUS.RECEIVED }); + await sendMessageToUserWithSuc(onlineRoleId, PUSH_ROUTE.PUBLIC_ACCOUNT_GIFT, { activityId, type: SNS_LINK_TYPE.WX_PUBLIC_ACCOUNT, status: playerRecord.hasReceived? BIND_PHONE_STATUS.RECEIVED: BIND_PHONE_STATUS.HAS_BIND }); } } \ No newline at end of file