✨ feat(活动): 微信公众号口令
This commit is contained in:
@@ -659,7 +659,9 @@ export async function redisSubScribe() {
|
||||
let treatGuildChannel = getRedisSubChannel(REDIS_KEY.TREAT_GUILD_CHANNEL, env);
|
||||
let surveyChannel = getRedisSubChannel(REDIS_KEY.SURVEY_CHANNEL, env);
|
||||
let userChannel = getRedisSubChannel(REDIS_KEY.USER_CHANNEL, env);
|
||||
await redisClientPub().subscribeAsync(payChannel, treatRoleChannel, treatGuildChannel, refundChannel, surveyChannel, userChannel);
|
||||
let publicAccountChannel = getRedisSubChannel(REDIS_KEY.PUBLIC_ACCOUNT_GIFT, env);
|
||||
let sendGiftCodeChannel = getRedisSubChannel(REDIS_KEY.SEND_GIFT_CODE, env);
|
||||
await redisClientPub().subscribeAsync(payChannel, treatRoleChannel, treatGuildChannel, refundChannel, surveyChannel, userChannel, publicAccountChannel, sendGiftCodeChannel);
|
||||
redisClientPub().on('message', (channel, message) => {
|
||||
console.log('**********redisSubScribe*******')
|
||||
console.log('channel: ', channel, payChannel);
|
||||
@@ -687,6 +689,15 @@ export async function redisSubScribe() {
|
||||
} else if(channel == userChannel) {
|
||||
let [sid, roleId] = (message||'').split('|');
|
||||
if(!!sid && !!roleId) pinus.app.rpc.connector.connectorRemote.remoteLogin.toServer(sid, roleId);
|
||||
} else if (channel == publicAccountChannel) {
|
||||
let servers = pinus.app.getServersByType('activity');
|
||||
let server = getRandSingleEelm(servers);
|
||||
pinus.app.rpc.activity.activityRemote.sendPublicAccountGift.toServer(server.id, message);
|
||||
} else if (channel == sendGiftCodeChannel) {
|
||||
let servers = pinus.app.getServersByType('role');
|
||||
let server = getRandSingleEelm(servers);
|
||||
pinus.app.rpc.role.roleRemote.sendGiftCodeMail.toServer(server.id, message);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user