✨ feat(活动): 微信公众号口令
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user