pier2

调试

前端打开debug模式,浏览器打开时在console里会打印微信分享初始化信息,在微信里会以alert形式出现。

常见问题

  1. 签名的时候注意大小写

  2. 签名时候用的url需要和当前位置的url保持一致

  3. 微信二次分享失败
    微信在第二次分享的链接里增加了后缀,如?from=singlemessage&isappinstalled=1,这里需要转义

     $.ajax({
         url: \'https://domain/wechatshare/sign?url=\' 
         	+ encodeURIComponent(window.location.href.split(\'#\')[0]),
         type: \'get\',
         success: function (data) {
             data = JSON.parse(data)
             data.jsApiList = [
                 \'onMenuShareTimeline\', \'onMenuShareAppMessage\',\'onMenuShareQQ\'
             ];
             wx.config(data);
         },
         error: function (xhr, textStatus) {
         }
     })

分类:

技术点:

相关文章:

  • 2021-12-12
  • 2021-10-03
  • 2021-11-27
  • 2021-08-30
  • 2021-12-15
  • 2021-11-27
猜你喜欢
  • 2021-11-26
  • 2021-12-19
  • 2021-11-19
  • 2021-11-30
  • 2021-12-31
相关资源
相似解决方案