云开发调用物流轨迹,报错怎么处理?
发布于 7 年前 作者 lei89 2641 次浏览 来自 官方Issues

晕开发调用物流轨迹{“errCode”:48001,“errMsg”:“openapi.logistics.getPath:fail api unauthorized hints: [MJKAHHXFe-hann4a!]”},这是什么意思,怎么处理,谢谢,

inde.js

// 云函数入口文件

const cloud = require('wx-server-sdk')


cloud.init()


// 云函数入口函数

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

const wxContext = cloud.getWXContext()

try {

const result = await cloud.openapi.logistics.getPath({

openid: event.openid,

orderId: event.orderId,

deliveryId: event.deliveryId,

waybillId: event.waybillId,

})

console.log(result)

return result

} catch (err) {

console.log(err)

return err

}

return {

event,

openid: wxContext.OPENID,

appid: wxContext.APPID,

unionid: wxContext.UNIONID,

}

}

config.json

{

"permissions": {

"openapi": [

"logistics.getPath"

]

}

}


package.json

{

"name": "wuliu",

"version": "1.0.0",

"description": "",

"main": "index.js",

"scripts": {

"test": "echo \"Error: no test specified\" && exit 1"

},

"author": "",

"license": "ISC",

"dependencies": {

"wx-server-sdk": "latest"

}

}

2 回复

你开通物流助手了吗

是只有企业用户才可以调用吗,查了好像需要认证

回到顶部