Administrator
3 days ago d257df31070190bc44bc44a52d513243f6c184f5
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -708,14 +708,19 @@
    @Override
    @Transactional
    public FebsResponse xcxLogin(ApiXcxLoginDto apiXcxLoginDto) throws IOException {
    public FebsResponse xcxLogin(ApiXcxLoginDto apiXcxLoginDto){
        log.info("登录请求参数:{}", JSONObject.toJSONString(apiXcxLoginDto));
        FebsResponse febsResponse = new FebsResponse();
        String code = apiXcxLoginDto.getCode();
        log.info("code:" + code);
        if (StrUtil.isNotBlank(code)) {
            String requrl = getXcxLoginUrl(code);
            String reslutData = HttpCurlUtil.sendGetHttp(requrl, null);
            String reslutData = null;
            try {
                reslutData = HttpCurlUtil.sendGetHttp(requrl, null);
            } catch (IOException e) {
                e.printStackTrace();
            }
            net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(reslutData);
            log.info("微信登录获取到登录信息={}", json);
@@ -742,6 +747,8 @@
                    entity.setSessionKey(sessionKey);
                    entity.setMemberUuid(UUID.getSimpleUUIDString());
                    log.info("公司编码={}", apiXcxLoginDto.getCompanyId());
                    if (StrUtil.isNotEmpty(apiXcxLoginDto.getCompanyId())){
                        YHAiCompany aiCompany = yhAiCompanyMapper.selectOne(
                                Wrappers.lambdaQuery(YHAiCompany.class)
@@ -762,6 +769,9 @@
                                        .isNull(YhAiMember::getRoleId)
                        );
                        Integer realNum = CollUtil.isEmpty(yhAiMembers) ? 0 : yhAiMembers.size();
                        log.info("公司会员数:{}", realNum);
                        log.info("公司会员数:{}", memberNum);
                        log.info("公司会员数:{}", realNum >= memberNum);
                        if (realNum >= memberNum){
                            throw new FebsException("公司会员已满");
                        }
@@ -799,8 +809,8 @@
            }
            YhAiMember yhAiMember = yhAiMemberMapper.selectById(entity.getId());
            String token = IdUtil.simpleUUID();
            redisUtils.set(token, JSONObject.toJSONString(yhAiMember), -1);
            redisUtils.set(redisKey, token, -1);
            redisUtils.set(token, JSONObject.toJSONString(yhAiMember), 60 * 60 * 24);
            redisUtils.set(redisKey, token, 60 * 60 * 24);
            Map<String, Object> authInfo = new HashMap<>();
            authInfo.put("token", token);
            authInfo.put("appid", xcxProperties.getXcxAppid());
@@ -862,8 +872,8 @@
            if (ObjectUtil.isNotEmpty(aiCompany)){
                companyId = aiCompany.getId();
            }
            entity.setCompanyId(companyId);
        }
        entity.setCompanyId(companyId);
        yhAiMemberMapper.updateById(entity);
        return new FebsResponse().success();