|  |  |  | 
|---|
|  |  |  | loginLog.setOsInfo(Utils.User_Client.getOS(request)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | loginLog.setServerIp(Utils.Server.getIP()); | 
|---|
|  |  |  | if(isDebug == null  || !isDebug){ | 
|---|
|  |  |  | if(isDebug == null  || !isDebug  && dto.getCheckCode()){ | 
|---|
|  |  |  | // 校验验证码 | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | captchaService.check(dto.getUuid(), dto.getCode()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public LoginUserInfo driverLogin(LoginDTO dto, ServerHttpRequest request) { | 
|---|
|  |  |  | SystemLoginLog loginLog = new SystemLoginLog(); | 
|---|
|  |  |  | loginLog.setLoginUsername(dto.getUsername()); | 
|---|
|  |  |  | loginLog.setLoginTime(new Date()); | 
|---|
|  |  |  | loginLog.setSystemVersion(systemVersion); | 
|---|
|  |  |  | loginLog.setLocation(Utils.Location.getLocationString(loginLog.getIp())); | 
|---|
|  |  |  | if(request!=null&&request.getHeaders()!=null && request.getHeaders().size()>0){ | 
|---|
|  |  |  | loginLog.setIp(Utils.User_Client.getIP(request)); | 
|---|
|  |  |  | loginLog.setPlatform(Utils.User_Client.getPlatform(request)); | 
|---|
|  |  |  | loginLog.setClientInfo(Utils.User_Client.getBrowser(request)); | 
|---|
|  |  |  | loginLog.setOsInfo(Utils.User_Client.getOS(request)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | loginLog.setServerIp(Utils.Server.getIP()); | 
|---|
|  |  |  | // 根据用户名查询用户对象 | 
|---|
|  |  |  | SystemUser queryDto = new SystemUser(); | 
|---|
|  |  |  | queryDto.setUsername(dto.getUsername()); | 
|---|
|  |  |  | queryDto.setDeleted(Boolean.FALSE); | 
|---|
|  |  |  | SystemUser user = systemUserService.findOne(queryDto); | 
|---|
|  |  |  | if (user == null) { | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String pwd = Utils.Secure.encryptPassword(new String(dto.getPassword()), user.getSalt()); | 
|---|
|  |  |  | // 比较密码 | 
|---|
|  |  |  | if( !StringUtils.equals(pwd, user.getPassword())){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Company company = new Company(); | 
|---|
|  |  |  | if(Objects.nonNull(user.getCompanyId())){ | 
|---|
|  |  |  | company = companyMapper.selectById(user.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LoginUserInfo userInfo = LoginUserInfo.from(user, null, null,company,null); | 
|---|
|  |  |  | return  userInfo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 内部人员 与 司机 根据code查询openId后进行登录接口 | 
|---|
|  |  |  | * @return | 
|---|