🐞 fix(37需求): 账号多开
This commit is contained in:
@@ -6,6 +6,7 @@ import { REDIS_KEY, SERVER_STATUS } from '@consts';
|
||||
import { getRedisSubChannel } from 'app/pubUtils/sdkUtil';
|
||||
import { ServerlistType } from '@db/Serverlist';
|
||||
import { nowSeconds } from 'app/pubUtils/timeUtil';
|
||||
import { checkWhiteList } from 'app/pubUtils/sysUtil';
|
||||
const csprng = require('csprng');
|
||||
/**
|
||||
* Utils Service
|
||||
@@ -63,8 +64,9 @@ export default class Utils extends Service {
|
||||
public async checkOnlineUser(userCode: string) {
|
||||
let redisClient: RedisClient = this.ctx.app.context.redisClient;
|
||||
let onlineRoleId = await redisClient.hgetAsync(REDIS_KEY.USER_CODE, userCode);
|
||||
let isWhiteList = await checkWhiteList(this.ctx.app.config.realEnv, this.ctx.clientIp, this.ctx.uid);
|
||||
|
||||
if (!!onlineRoleId) { // 多地登陆踢下线
|
||||
if (!isWhiteList && !!onlineRoleId) { // 多地登陆踢下线
|
||||
let str = await redisClient.hgetAsync(REDIS_KEY.ONLINE_USERS, onlineRoleId);
|
||||
|
||||
if(str) {
|
||||
|
||||
Reference in New Issue
Block a user