public ActionResult ForgetPassword(string phoneNum, string verifyCode, string newPassword) { if (verifyCode != (string)TempData["verifyCode"]) { return(Json(new AjaxResult() { Status = "error", ErrorMsg = "验证码错误" })); } var checkIsPhoneNum = userService.GetByPhoneNum(phoneNum); var userId = FrontUtils.GetUserId(HttpContext); if (checkIsPhoneNum != null) { userService.UpdatePwd(userId.Value, newPassword); return(Json(new AjaxResult { Status = "ok" })); } else { return(Json(new AjaxResult { Status = "error", ErrorMsg = "修改密码错误" })); } }
/// <summary> /// 切换当前用户的城市Id /// </summary> /// <param name="cityId"></param> /// <returns></returns> public ActionResult SwitchCityId(long cityId) { long?userId = FrontUtils.GetUserId(HttpContext); if (userId == null)//无人登录 { Session["CityId"] = cityId; } else { userService.SetUserCityId((long)userId, cityId); } return(Json(new AjaxResult { Status = "ok" })); }
public ActionResult MakeAppointment(HouseMakeAppointMentModel model) { if (!ModelState.IsValid) { string msg = MVCHelper.GetValidMsg(ModelState); return(Json(new AjaxResult() { Status = "Error", ErrorMsg = msg })); } long?userId = FrontUtils.GetUserId(HttpContext); appService.AddNew(userId, model.Name, model.PhoneNum, model.HouseId, model.VisitDate); return(Json(new AjaxResult { Status = "ok" })); }
public ActionResult SwitchCityId(long?cityId) { //判断session里是否有用户不登录 long?userId = FrontUtils.GetUserId(HttpContext); if (userId == null)//无人登录 { Session["CityId"] = cityId; } else { //切换当前用户的城市Id userService.SetUserCityId((long)userId, (long)cityId); } return(Json(new AjaxResult() { Status = "ok" }));; }