云函数名称
msgSecCheck
开始时间
2019-07-20 14:29:14
时长
85.6ms
计费时长
100ms
调用完成
是
内存使用
16.97 MB
Request ID
b1a4493c-aab7-11e9-a24c-525400b2c41b
调用状态
失败, ret code 1
返回结果
{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:“errCode: -501007 invalid parameters | errMsg: security.msgSecCheck:fail Invalid request param”}
调用日志
START RequestId: b1a4493c-aab7-11e9-a24c-525400b2c41b
Event RequestId: b1a4493c-aab7-11e9-a24c-525400b2c41b
Error: errCode: -501007 invalid parameters | errMsg: security.msgSecCheck:fail Invalid request param
at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6360:28)
at Object.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:434:35)
at step (/var/user/node_modules/tslib/tslib.js:136:27)
at Object.next (/var/user/node_modules/tslib/tslib.js:117:57)
at fulfilled (/var/user/node_modules/tslib/tslib.js:107:62)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
END RequestId: b1a4493c-aab7-11e9-a24c-525400b2c41b
Report RequestId: b1a4493c-aab7-11e9-a24c-525400b2c41b Duration:85ms Memory:256MB MaxMemoryUsed:16.968750MB
我也遇到这个问题,请问有人成功过么?
__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”:“吃屎”
}
返回一样的错误,怎么改都白搭