是一样的,我只调用了scanQRCode,所以只填了这个,安卓用是没有问题的,说明接口与签名是OK,就IOS点不出来
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
let innerurl = ''
if (isAndroid) {
innerurl = location.href.split('#')[0]
}
if (isIOS) {
innerurl =window.entryUrl
}
var url = Forguncy.ForguncyData.ForguncyRoot + 'customapi/wechatapi/getsignature';
var data =
{
"url": innerurl,
};
$.post(url, data, function (result) {
console.log(result);
var valueList = JSON.parse(result);
wx.config({
debug: false,
appId: valueList.appid,
timestamp: valueList.timestamp,
nonceStr: valueList.nonceStr,
signature: valueList.signature,
jsApiList: ["scanQRCode"] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
});
wx.error(function (res) {
});
});
|