| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | 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("实名认证失败,姓名或者身份证号有误"); |
| | | } |
| | | |
| | | |