一直抱这个错误,小程序和服务号都配置了,为什么还不行,服务号是新申请的,还么有认证,这个影响吗?
代码如下
const nonceStr = 'Wm3WZYTPz0wzccnW' // 随机字符串
const timestamp = new Date().getTime() // 时间戳
const url = window.location.href.split('#')[0] // 当前网页url
const str =
'jsapi_ticket=' +
response.data +
'&noncestr=' +
nonceStr +
'×tamp=' +
timestamp +
'&url=' +
url
console.log('str:', str)
const signature = that.sha1(str) // sha1加密
let config = {
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: this.APPID, // 必填,公众号的唯一标识
timestamp: timestamp, // 必填,生成签名的时间戳
nonceStr: nonceStr, // 必填,生成签名的随机串
signature: signature, // 必填,签名
jsApiList: ['scanQRCode'] // 必填,需要使用的JS接口列表
}
wx.config(config)

你好,详细请参考文档:https://developers.weixin.qq.com/doc/service/guide/h5/jssdk.html#%E9%99%84%E5%BD%95-%E5%B8%B8%E8%A7%81%E9%94%99%E8%AF%AF%E5%8F%8A%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95
1,服务号认证还没有
2,开发密钥冻结
3,你指的是哪些ip?是签名中的那个url吗?
4,服务号我现在找人认证一下