小程序 web-view 调用 jssdk config 提示 {"realAuthUrl": "[https://xx.xx.com/wx/, https://xx.xx.com/wx/]", "errMsg": "config:invalid signature"}
request合法域名 和 业务域名 已配置 xx.xx.com
微信 JS 接口签名校验工具测试也是一致的
url 也是 获取正常的
export const initJWeiXin = async (jsList = []) => {
// if (isWeiXin()) {
console.log(window.location.href, 'href');
const result = await getJWeiXinConfig(window.location.href.split('#')[0]);
console.log(result, 'result');
if (result.data.appId && result.status !== 200) {
return console.log('请求异常');
}
window.wx.config({
appId: result.data.appId,
debug: true,
jsApiList: [
// 'checkJsApi',
// 'onMenuShareAppMessage',
// 'onMenuShareTimeline',
...jsList,
// 所有要调用的 API 都要加到这个列表中
],
noncestr: result.data.nonceStr,
signature: result.data.signature,
timestamp: result.data.timestamp,
});
window.wx.ready(function (res) {
console.log('ready success', res);
window.wx.checkJsApi({
jsApiList: jsList,
success: function () {
console.log('checkJsApi success');
},
});
});
window.wx.error(function (res) {
console.log('wx.error', res);
});
// }
};
通了和上面没关系
参考下是不是这个问题:https://developers.weixin.qq.com/community/develop/doc/000ee0e1f7c8d824b9024298561800
跟request域名,webview业务域名毫无关系。签名校验工具只是说明算法正确,不代表百分百能用。你代码全是变量,提出来没意义。提供h5地址