public void SetAuthorize(AccountAuthorizeInfo info) { var userId = info.LoginId; var client = info.Client; var value = JsonConvert.SerializeObject(info); cache.SetCache(UAER_PREFIX + "_" + client + "_" + userId, value, expiryTime); }
/// <summary> /// /// </summary> /// <param name="verifyInfo"></param> /// <returns></returns> public string CreateAuthorization(VerifyInfo verifyInfo) { if (verifyInfo == null) { throw new ArgumentNullException(nameof(verifyInfo)); } var cacheData = JsonConvert.SerializeObject(verifyInfo); var data = $"{verifyInfo.Id}|{verifyInfo.Key}|{DateTime.Now.ToString("yyyy-MM-DDTHH:mm:ss")}"; var token = encryptor.Encrypt(data); cacheAgent.SetCache($"{USER_PREFIX}_{verifyInfo.Id}", cacheData, expiry); return(token); }