Commit a25dd36be63b53c535c4dd390653e62ef1f764c5
1 parent
10a40f21
fix(mp): 修复公众号关注时 48001 错误码兜底失效
将微信异常错误码与 WxMpErrorMsgEnum.CODE_48001.getCode() 比较, 避免 int 与枚举实例比较导致个人订阅号无接口权限场景无法创建粉丝信息。 对应 https://t.zsxq.com/xy7I6
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-module-mp/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/SubscribeHandler.java
| ... | ... | @@ -43,7 +43,7 @@ public class SubscribeHandler implements WxMpMessageHandler { |
| 43 | 43 | } catch (WxErrorException e) { |
| 44 | 44 | log.error("[handle][粉丝({})] 获取粉丝信息失败!", wxMessage.getFromUser(), e); |
| 45 | 45 | // 特殊情况(个人账号,无接口权限):https://t.zsxq.com/cLFq5 |
| 46 | - if (ObjUtil.equal(e.getError().getErrorCode(), WxMpErrorMsgEnum.CODE_48001)) { | |
| 46 | + if (ObjUtil.equal(e.getError().getErrorCode(), WxMpErrorMsgEnum.CODE_48001.getCode())) { | |
| 47 | 47 | wxMpUser = new WxMpUser(); |
| 48 | 48 | wxMpUser.setOpenId(wxMessage.getFromUser()); |
| 49 | 49 | wxMpUser.setSubscribe(true); | ... | ... |