security.msgSecCheck:fail Invalid reques
- 当前 Bug 的表现(可附上截图)
{“errCode”:-501007,“errMsg”:“security.msgSecCheck:fail Invalid request param”}
云服务器调用内容安全接口,返回数据有误,应该如何调用呢
config.json
{
"permissions": {
"openapi": [
"security.msgSecCheck"
]
}
}
index.js
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
// 云函数入口函数
exports.main = async (event, context) => {
const {content} = event;
try {
const res = await cloud.openapi.security.msgSecCheck({
content:event.content
})
return res;
} catch (err) {
return {title:'错误',data:err};
}
}
云端测试数据
{
"content":"吃屎"
}
返回一样的错误,怎么改都白搭
3 回复
-501007 | 云资源通用错误:参数错误 |
请检查一下参数:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference/errcode.html