!224 fix(system): 当用户没有绑定微信小程序时获取到socialUser为null,会导致发货失败

Merge pull request !224 from wuKong/fix(system)-当用户没有绑定微信小程序时获取到socialUser为null,会导致发货失败
This commit is contained in:
芋道源码 2025-12-20 09:45:40 +00:00 committed by Gitee
commit bec1b083ec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -86,7 +86,7 @@ public class SocialClientApiImpl implements SocialClientApi {
// 2. 获得社交用户
SocialUserRespDTO socialUser = socialUserService.getSocialUserByUserId(reqDTO.getUserType(), reqDTO.getUserId(),
SocialTypeEnum.WECHAT_MINI_PROGRAM.getType());
if (StrUtil.isBlankIfStr(socialUser.getOpenid())) {
if (ObjUtil.isNull(socialUser) || StrUtil.isBlankIfStr(socialUser.getOpenid())) {
log.warn("[sendWxaSubscribeMessage][reqDTO({}) 发送订阅消息失败,原因:会员 openid 缺失]", reqDTO);
return success(false);
}