前端JS大概这么写
document.write("<script src=\"https:\/\/res2.wx.qq.com\/open\/js\/jweixin-1.6.0.js\"><\/script>"); $.ajax({ type: "GET", url: pcurl + 'ecmsapi/index.php?mod=wechat&act=gzh&ticket=ticket',//上面的api dataType: "json", data: {"url": location.href.split("#")[0]}, success: function(json) { wx.config({ debug: false, appId: json.data.appid, timestamp: json.data.timestamp, nonceStr: json.data.noncestr, signature: json.data.signature, jsApiList: ['updateAppMessageShareData','updateTimelineShareData','getNetworkType'] }); //分享哪些东西了自行安排 });
|