public JsonResult getpassword(string account, string accounttype, string password, string verifycode) { string message = string.Empty; Entity.Error error = Entity.Error.请求成功; var mobilecode = Config.UserConfig.getVerifyCode(account); if (mobilecode != null && mobilecode.Code == verifycode && mobilecode.Deadline >= Config.SiteConfig.getLocalTime()) { if (mobilecode.Account == account) { using (var manage = new bitcms.Data.CMSManage()) { var userBindInfo = manage.getUserBindInfo(accounttype, account); if (userBindInfo != null && userBindInfo.UserId > 0) { manage.updatePassword(userBindInfo.UserId, Entity.passwordType.user, password); } } } else { error = Entity.Error.错误; message = "验证账号和原账号不一致!"; } } else { error = Entity.Error.错误; message = "验证码错误或已经过期!"; } return(this.getResult(error, message)); }
public ActionResult updateUserPassword(string oldpassword, string password) { using (var manage = new bitcms.Data.CMSManage()) { manage.updatePassword(this.userOnlineInfo.UserId, Entity.passwordType.user, oldpassword, password); return(this.getResult(manage.Error, manage.Message)); } }