Esempio n. 1
0
        public async Task <IHttpActionResult> UpdatePwd([FromBody] string userName, string pwd)
        {
            return(await ResultFactory.Create(ModelState, async arg =>
            {
                var user = await SysUserService.GetAsync(u => u.UserName.Equals(userName));
                user.Password = pwd;
                user.UpdateTime = DateTime.Now;

                var result = await SysUserService.UpdateAsync(user) > 0;
                return new ApiResult(result ? ExceptionCode.Success : ExceptionCode.InternalError, "",
                                     null);
            }, userName, "success", "请检查请求参数"));
        }