错误码 -501001
发布于 4 年前 作者 gang69 9444 次浏览 来自 问答

用云函数调用小程序码,不管用哪种方式,都是返回errCode-501001errMsg“openapi.wxacode.get:fail 1”

没有任何解释,怎么解决?

代码如下:

exports.main = async (event, context) => {

try{

const result = await cloud.openapi.wxacode.get({

path: ‘pages/index/index’,

width: 430

})

console.log(result)

return result

} catch(err){

console.log(err)

return err

}

}

1 回复

是否有使用最新版的工具上传云函数呢?应该是没有 API 权限:

最新版工具:https://developers.weixin.qq.com/miniprogram/dev/devtools/nightly.html?t=19040410

云调用文档: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/openapi.html

回到顶部