Exemple #1
0
        public JsonResult ChangePw(IFormCollection collection)
        {
            var entity = new ChangePwViewModel();

            TryUpdateModelAsync(entity);

            if (string.IsNullOrWhiteSpace(entity.OldPw) || string.IsNullOrWhiteSpace(entity.NewPw))
            {
                return(Json("原密码和新密码不能为空"));
            }
            entity.Id = AppUser.Id;
            var service = new AppUserService();
            var result  = service.ChangePw(entity.Id, entity.OldPw, entity.NewPw);

            return(Json(result));
        }