/// <summary> /// 用户登录 /// </summary> /// <param name="weChatLoginViewModel"></param> /// <returns></returns> public List <User_Info> ValideNewUserInfo(WeChatUpdateViewModel weChatUpdateViewModel) { List <User_Info> SearchResultTemp = DbSet.Where(a => a.UserId == weChatUpdateViewModel.UserId && a.UserPwd == weChatUpdateViewModel.UserPwd && a.status == "0") .ToList(); return(SearchResultTemp); }
/// <summary> /// 根据账号和密码查询用户信息(用于存储session) /// </summary> /// <param name="weChatUpdateViewModel"></param> /// <returns></returns> public int WeChatLogin_User_Update(WeChatUpdateViewModel weChatUpdateViewModel) { var user_Infos = _ILoginRepository.ValideNewUserInfo(weChatUpdateViewModel); if (user_Infos.Count == 0) { return(0); } else { var user_Info = _IUserInfoRepository.GetInfoByUserid(user_Infos[0].Id); user_Info.UserPwd = weChatUpdateViewModel.NewUserPwd; _IUserInfoRepository.Update(user_Info); _IUserInfoRepository.SaveChanges(); return(1); } }
public ActionResult <WeChatLoginResModel> Manage_User_UpdatePassword(WeChatUpdateViewModel weChatUpdateViewModel) { WeChatLoginResModel weChatLoginResModel = new WeChatLoginResModel(); var UserSearchResult = _loginService.WeChatLogin_User_Update(weChatUpdateViewModel); if (UserSearchResult == 0) { weChatLoginResModel.IsSuccess = false; weChatLoginResModel.baseViewModel.Message = "用户名不存在或者密码错误"; weChatLoginResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("用户名不存在或者密码错误,修改密码失败"); return(Ok(weChatLoginResModel)); } else { weChatLoginResModel.IsSuccess = true; weChatLoginResModel.baseViewModel.Message = "存在该用户,修改密码成功"; weChatLoginResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("查询用户信息,存在该用户,修改密码成功"); return(Ok(weChatLoginResModel)); } }