rentaiming
2024-06-27 e1a712365d41a30f9a7654323065438416722be6
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
@@ -179,7 +179,11 @@
                        appMiniLoginVo.setZfbuserid(response.getOpenId());
                        appMiniLoginVo.setSysUser(sysUser);
                        appMiniLoginVo.setMemberid(member.getId());
                        redisService.setCacheObject(SecurityConstant.SESSION_KEY + response.getUserId(), null, 1L, TimeUnit.DAYS);
                        Member byId = this.getById(member.getId());
                        if (appMiniLoginDto.getPhone()!=null){
                            byId.setPhone(appMiniLoginDto.getPhone());
                            this.updateById(byId);
                        }
                    }else{
                        //创建新用户
                        String memberId = IdUtils.simpleUUID();
@@ -272,11 +276,13 @@
                    appMiniLoginVo.setWxUnionid(member.getWxUnionid());
                    appMiniLoginVo.setSysUser(sysUser);
                    appMiniLoginVo.setMemberid(member.getId());
                    Member byId = this.getById(member.getId());
                    if (appMiniLoginDto.getPhone()!=null){
                        byId.setPhone(appMiniLoginDto.getPhone());
                        this.updateById(byId);
                    }
                redisService.setCacheObject(SecurityConstant.SESSION_KEY + openid, sessionKey, 1L, TimeUnit.DAYS);
                }
            }
        }
@@ -344,13 +350,13 @@
                response.close();
                httpClient.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
                throw new RuntimeException("姓名或者身份证号有误");
            }
        }
     JSONObject jsonObject= JSON.parseObject(result);
        String object1= jsonObject.get("reason").toString();
        if(!object1.equals("成功")){
            throw new ServiceException(object1);
            throw new ServiceException("实名认证失败,姓名或者身份证号有误");
        }