/// <summary> /// 创建一个30S的单点登录等待状态token(实际上是31S 预留1S的缓冲时间) /// </summary> /// <param name="signleLoginToken"></param> /// <returns></returns> public bool CreateWaitToken(SignleLoginToken signleLoginToken) { if (!redisHelper.KeyExists(signleLoginToken.AccountId)) { return(redisHelper.StringSet(signleLoginToken.AccountId, signleLoginToken.Token, new TimeSpan(0, 0, 33))); } else { return(false); } }
/// <summary> /// 用户状态Token创建 /// </summary> /// <param name="signleLoginToken"></param> /// <returns></returns> public bool CreateToken(SignleLoginToken signleLoginToken) { return(redisHelper.HashSet(RedisKey, signleLoginToken.AccountId, signleLoginToken.Token)); }