Ejemplo n.º 1
0
        public ActionResult ChangePasswordAfterLogin(string returnUrl = null)
        {
            var model = new ChangePasswordAfterLoginModel {
                ReturnUrl = returnUrl
            };

            if (!model.Enable)
            {
                throw new EzCMSNotFoundException();
            }
            return(View("Login/ChangePasswordAfterLogin", model));
        }
Ejemplo n.º 2
0
        public ActionResult ChangePasswordAfterLogin(ChangePasswordAfterLoginModel model)
        {
            if (ModelState.IsValid)
            {
                model.UserId = WorkContext.CurrentUser.Id;

                var response = _userService.ChangePasswordAfterLogin(model);

                return(Json(response));
            }

            return(Json(new ResponseModel
            {
                Success = false,
                Message = ModelState.BuildValidationMessages()
            }));
        }