|
|
@@ -105,6 +105,18 @@ public class EventMsgService implements GzhMsgService {
|
|
|
|
|
|
User user = userService.getSyncUser(info.getOpenid(), info.getUnionid(), wxSyncLog);
|
|
|
|
|
|
+ String state = redisService.getStr(RedisService.key.WX_GZH_QRCODE_SHARED_LOGIN.getNameFormat(sceneKey));
|
|
|
+ GzhBodyDto gzhDto = null;
|
|
|
+ if (StrUtil.isNotEmpty(state)) {
|
|
|
+ // 转跳参数
|
|
|
+ String json = Codec.DoBase64.custom().setData(state).decodeAsText();
|
|
|
+ if (StrUtil.isNotEmpty(json)) {
|
|
|
+ try {
|
|
|
+ gzhDto = Jsons.parseObject(json, GzhBodyDto.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (user == null) {
|
|
|
user = new User();
|
|
|
user.setNickname(String.format("%s%s", Constant.DEFAULT_NAME, Codec.DoDigest.custom().setAlgorithm(Codec.DoDigest.Algorithm.MD5).setStringData(RandomUtil.randomString(10)).toHexString().substring(0, 6)))
|
|
|
@@ -117,14 +129,12 @@ public class EventMsgService implements GzhMsgService {
|
|
|
user.setUnionid(info.getUnionid());
|
|
|
userMapper.insert(user);
|
|
|
|
|
|
- Object gzhDtoObj = redisService.get(RedisService.key.WX_GZH_QRCODE_SHARED_LOGIN.getNameFormat(sceneKey));
|
|
|
- if (gzhDtoObj != null) {
|
|
|
- GzhBodyDto gzhBodyDto = Jsons.parseObject(gzhDtoObj, GzhBodyDto.class);
|
|
|
- Long sharedId = gzhBodyDto.getSharedId();
|
|
|
+ if (gzhDto != null) {
|
|
|
+ Long sharedId = gzhDto.getSharedId();
|
|
|
if (sharedId != null) {
|
|
|
distributeService.saveDistributionInvitation(sharedId, user.getId());
|
|
|
}
|
|
|
- Long popularizeId = gzhBodyDto.getPopularizeId();
|
|
|
+ Long popularizeId = gzhDto.getPopularizeId();
|
|
|
if (popularizeId != null) {
|
|
|
userMapper.update(null, Wrappers.lambdaUpdate(User.class)
|
|
|
.eq(User::getId, user.getId())
|