
- 报这种错误 是因为 公众号的 jsdk api 使用 之前 需要 在 jsApiList 数组中添加该api
wx.config({
debug: true,
appId: data.appId, // 必填,公众号的唯一标识
timestamp: data.timestamp, // 必填,生成签名的时间戳
nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名
jsApiList: [
"chooseImage",
"getLocalImgData",
"updateAppMessageShareData"
] // 必填,需要使用的JS接口列表
});
本文详细介绍了在使用微信公众号JSAPI时遇到的配置错误,重点讲解了必须在jsApiList数组中添加相应的API才能正常使用。通过示例代码展示了如何正确配置wx.config,包括设置debug模式、appId、timestamp、nonceStr、signature以及必要的JS接口列表,如“chooseImage”、“getLocalImgData”和“updateAppMessageShareData”。确保这些步骤正确执行是避免出现错误的关键。

被折叠的 条评论
为什么被折叠?



