public JsonResult UpdatePassword(UserUpdatePasswordVo userUpdate) { userUpdate.OldPassword = AuthManager.EncryptPassword(userUpdate.OldPassword); userUpdate.NewPassword = AuthManager.EncryptPassword(userUpdate.NewPassword); UserService.UpdatePassword(userUpdate, AuthManager.ReadUserInfo()); return(Json(this.Ok(true))); }
public JsonResult InserUser(UserEntity userEntity) { string encrptedPassword = AuthManager.EncryptPassword(userEntity.LoginPassword); userEntity.LoginPassword = encrptedPassword; UserService.Insert(userEntity, AuthManager.ReadUserInfo()); return(Json(this.Ok(true))); }
/// <summary> /// 得到存入数据库的密码 /// </summary> /// <param name="rsaPassword">js RSA 加密传输过来的密码</param> /// <returns></returns> private static string GetHashPassword(string rsaPassword) { //rsa解密 Asym_RSA rsa = new Asym_RSA(); rsaPassword = rsa.EncryptForJSDecrypt(rsaPassword); //MD5加密 rsaPassword = AuthManager.EncryptPassword(rsaPassword); return(rsaPassword); }
public JsonResult Login(string account, string password, string verifycode) { string encrptedPassword = AuthManager.EncryptPassword(password); var loginUser = AuthManager.Login(account, encrptedPassword, verifycode, true); return(Json(new AjaxResult { Success = true, Data = new { UserInfo = loginUser } })); }