$.ajax({
url: Sys_Server.server + '/sso/wechatParam',
data:{
url:location.href.split('#')[0]
},
async:false,
success:function(res) {
console.log('res',res)
wx.config({
beta: true,
appId: res.data.appId,
timestamp: res.data.timestamp,
nonceStr: res.data.noncestr,
signature: res.data.signature,
jsApiList: ["onMenuShareAppMessage","onMenuShareWechat","onMenuShareTimeline","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","previewFile","getNetworkType","onNetworkStatusChange","openLocation","getLocation","startAutoLBS","stopAutoLBS","onLocationChange","onHistoryBack","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","openDefaultBrowser","scanQRCode","selectEnterpriseContact","openEnterpriseChat","chooseInvoice","selectExternalContact","getCurExternalContact","openUserProfile","shareAppMessage","shareWechatMessage","startWifi","stopWifi","connectWifi","getWifiList","onGetWifiList","onWifiConnected","getConnectedWifi","setClipboardData","getClipboardData"]
})
}
})
wx.ready(function(){
console.log('ready成功')
wx.onHistoryBack(function(){
alert('监听到了')
if(location.href.indexOf('wxWork/index.html') !== -1){
alert(location.href)
wx.closeWindow();
}else {
return true
}
});
})