/// <summary> /// 用户登陆 /// </summary> public ActionResult LoginCheck(String data) { AjaxRspModel Rsp = new AjaxRspModel(); log.Debug("User login, user Info is " + data); try { SystemUser loginUser = JsonConvert.JsonToObject<SystemUser>(data); Session["SystemUser"] = loginService.Login(loginUser); } catch (FuegoException e) { log.Error("cancel failed", e); Rsp.ErrorCode = e.GetErrorCode(); } catch (SystemException e) { log.Error("cancel failed", e); Rsp.ErrorCode = ExceptionMsg.FAIL; } return Content(JsonConvert.ObjectToJson(Rsp)); }
/// <summary> /// 修改密码 public ActionResult ModifyPswd(string data) { AjaxRspModel Rsp = new AjaxRspModel(); try { SystemUser user = (SystemUser)Session["SystemUser"]; PswdModel pwd = JsonConvert.JsonToObject<PswdModel>(data); loginService.ModifyPswd(user.UserName, pwd.OldPswd, pwd.NewPswd); } catch (FuegoException e) { log.Error("create failed", e); Rsp.ErrorCode = e.GetErrorCode(); } catch (Exception e) { log.Error("create failed", e); Rsp.ErrorCode = ExceptionMsg.FAIL; } return Content(JsonConvert.ObjectToJson(Rsp)); }