|
|
|
@@ -10,6 +10,7 @@ import me.chanjar.weixin.mp.api.WxMpService; |
|
|
|
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; |
|
|
|
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; |
|
|
|
import me.chanjar.weixin.mp.bean.result.WxMpUser; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
@@ -47,8 +48,10 @@ public class SubscribeHandler extends AbstractHandler { |
|
|
|
WxMpUser userWxInfo = weixinService.getUserService() |
|
|
|
.userInfo(wxMessage.getFromUser()); |
|
|
|
if (userWxInfo != null) { |
|
|
|
this.logger.info(userWxInfo.toString()); |
|
|
|
userService.saveOrUpdateMpUser(userWxInfo, authorizerInfo); |
|
|
|
if(StringUtils.isNotBlank(userWxInfo.getUnionId())) { |
|
|
|
this.logger.info(userWxInfo.toString()); |
|
|
|
userService.saveOrUpdateMpUser(userWxInfo, authorizerInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (WxErrorException e) { |
|
|
|
if (e.getError().getErrorCode() == 48001) { |
|
|
|
|