public JsonResult updatePwd(string userAccount, string userPassword) { string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(userPassword, "md5"); int ret = webUserservice.UpdateWebUserPassword(userAccount, pwd); return(Json(new { RetCode = ret })); }
public int UpdateUserPassword(string userAccount, string OriginPwd, string userPassword) { string oldpwd = FormsAuthentication.HashPasswordForStoringInConfigFile(OriginPwd, "md5"); string userpwd = FormsAuthentication.HashPasswordForStoringInConfigFile(userPassword, "md5"); bool bit = webUserservice.ExistUser(userAccount, oldpwd); if (bit) { webUserservice.UpdateWebUserPassword(userAccount, userpwd); return(1); } else { //旧密码错误 return(0); } }