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