!security.msgSecCheck为什么老是调用异常?
用过了所有方法包括用encoding将text转成utf8 和POST都不行,无论如何还是返回-501007不知道这个函数到底要怎么用啊!!!!!
cloud.init() // 云函数入口函数 exports.main = async (event, context) => { console.log( "damn it the input text is:" ,event.text) try { const res = await cloud.openapi.security.msgSecCheck({ content: event.text }) return res; } catch (err) { return { title: '错误' , data: err }; } } |
//config.json { "permissions" : { "openapi" : [ "security.msgSecCheck" ] } } |
云端测试返回结果是:
日志内容 Request ID: e7b9f394-1113-11ea-8114-5254007aa7a1 执行时间: 70.75ms内存使用: 39.66 MB 返回结果 {"title":"错误","data":{"errCode":-501007,"errMsg":"security.msgSecCheck:fail Invalid request param"}} 日志 START RequestId: e7b9f394-1113-11ea-8114-5254007aa7a1 Event RequestId: e7b9f394-1113-11ea-8114-5254007aa7a1 2019-11-27T12:46:17.846Z damn it the input text is: fuckyou!! END RequestId: e7b9f394-1113-11ea-8114-5254007aa7a1 Report RequestId: e7b9f394-1113-11ea-8114-5254007aa7a1 Duration:70ms Memory:256MB MaxMemoryUsed:39.664062MB |
搞了好久都弄不了,所有能搜索到的解决方法都试了一遍都不行,绝望了。。。。跪求指点!!!