feat(活动): 微信公众号口令

This commit is contained in:
luying
2023-04-04 10:11:05 +08:00
parent 94b6dca4cc
commit cecd959c00
22 changed files with 441 additions and 43 deletions
+22
View File
@@ -77,6 +77,28 @@ export default class Utils extends Service {
}
}
public async pushPubAccountGiftChannel(activityId: number, userCode: string, channelId: string) {
let redisClient: RedisClient = this.ctx.app.context.redisClient;
try {
let name = getRedisSubChannel(REDIS_KEY.PUBLIC_ACCOUNT_GIFT, this.ctx.app.config.env);
await redisClient.publishAsync(name, `${activityId}|${userCode}|${channelId}`);
} catch(e) {
console.error('pushPubAccountGiftChannel', e);
}
}
public async pushGiftCodeChannel(roleId: string, giftCode: string) {
let redisClient: RedisClient = this.ctx.app.context.redisClient;
try {
let name = getRedisSubChannel(REDIS_KEY.SEND_GIFT_CODE, this.ctx.app.config.env);
await redisClient.publishAsync(name, `${roleId}|${giftCode}`);
} catch(e) {
console.error('pushPubAccountGiftChannel', e);
}
}
// 检测是否可以登录
public async validateCanLogin() {
if(gameData.serverConst.CLOSE_LOGIN == 1) return false;