Kaynağa Gözat

#MOD PC端微信扫码绑定公众号

tanbin 1 yıl önce
ebeveyn
işleme
a0513a1fe0

+ 3 - 4
sys-api-service/src/main/java/com/xy/service/UserInfoServiceImpl.java

@@ -76,7 +76,6 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
 
     private WebMqttConfig webMqttConfig;
 
-    private WxMpService wxService;
 
     private WeChatOfficialConfig weChatOfficialConfig;
 
@@ -262,9 +261,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
             //当前登录用户
             userId = AuthorizeUtils.getLoginId(String.class);
         }
-        WxMpQrCodeTicket ticket = wxService.getQrcodeService().qrCodeCreateTmpTicket(userId, 2592000);
+        WxMpQrCodeTicket ticket = wxMpService.getQrcodeService().qrCodeCreateTmpTicket(userId, 2592000);
         String tk = ticket.getTicket();
-        String url = wxService.getQrcodeService().qrCodePictureUrl(tk);
+        String url = wxMpService.getQrcodeService().qrCodePictureUrl(tk);
         JList<String> contents = new JArrayList<>();
         contents.set(url);
         JList<String> text = new JArrayList<>();
@@ -303,7 +302,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
         String signature = request.getParameter(WeChatOfficialConfig.SIGNATURE);
         String nonce = request.getParameter(WeChatOfficialConfig.NONCE);
         String timestamp = request.getParameter(WeChatOfficialConfig.TIMESTAMP);
-        if (!wxService.checkSignature(timestamp, nonce, signature)) {
+        if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
             throw new CommRuntimeException("接收微信的事件消息,验签异常!");
         }
         log.info("接收微信的事件消息:{}", wxServiceMsgDto);