| | |
| | | } |
| | | String token = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_TOKEN).getCode(); |
| | | //根据code换区企业微信ID |
| | | QywxBaseResponse<String> qwIdBaseResponse= null;// QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | // if(Objects.isNull(qwIdBaseResponse)||Objects.isNull(qwIdBaseResponse.getErrcode())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录码解析失败,请联系管理员"); |
| | | // } |
| | | // if(!Constants.equalsInteger(qwIdBaseResponse.getErrcode(),Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录失败:"+qwIdBaseResponse.getErrmsg()); |
| | | // } |
| | | // if(Objects.isNull(qwIdBaseResponse.getData())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信用户信息解析失败,请联系管理员"); |
| | | // } |
| | | // String qwId = qwIdBaseResponse.getData(); |
| | | String qwId = dto.getCode(); |
| | | QywxBaseResponse<String> qwIdBaseResponse = QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | if(Objects.isNull(qwIdBaseResponse)||Objects.isNull(qwIdBaseResponse.getErrcode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录码解析失败,请联系管理员"); |
| | | } |
| | | if(!Constants.equalsInteger(qwIdBaseResponse.getErrcode(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录失败:"+qwIdBaseResponse.getErrmsg()); |
| | | } |
| | | if(Objects.isNull(qwIdBaseResponse.getData())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信用户信息解析失败,请联系管理员"); |
| | | } |
| | | String qwId = qwIdBaseResponse.getData(); |
| | | // String qwId = dto.getCode(); |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getQwId,qwId).eq(Member::getIsdeleted,Constants.ZERO).last(" limit 1 ")); |
| | | if(Objects.isNull(member)){ |
| | | //根据企业微信ID 查询用户信息 |