public void UserCreateTest() { var aa = CryptogramHelper.DESEncrypt("e10adc3949ba59abbe56e057f20f883e", "12345678"); var str = AppSettingsHelper.GetString("LogDirectory"); Console.Write(aa); }
protected string SetLoginToken(SysUserEntity user, List <int> roleIds) { var sessionUser = new LoginUserView { //OrgId = user.OrgId, UserName = user.UserName, //UserCode = user.UserCode, UserId = user.UserId, RoleIds = roleIds }; //HttpContext.Session.SetString(LoginSessionKey, sessionUser.JsonSerialize()); //存入缓存 //建议用redis存取加密密钥,和用户登录状态 //DES加密用户信息给出Token return(CryptogramHelper.DESEncrypt(sessionUser.JsonSerialize(), DateTime.Now.ToString("yyyyMMdd"))); }