const cloud = require('wx-server-sdk')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV,
})
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.security.msgSecCheck({
"openid": 'o5EaQ5eM6RWreXTqCGmB8aRrFJVk',
"scene": 1,
"version": 2,
"content": event.content
})
return result
} catch (err) {
return err
}
}微信端
wx.cloud.callFunction({
name: 'contentcheck',
data: {
content: "sh"
}
}).then((res) => {
console.log(res)
if (res.result.code == "200") {
console.log('监测通过')
} else {
wx.showToast({
title: '包含敏感字哦。',
icon: 'none',
duration: 3000
})
}
})
如题,这样子应该怎么搞啊,求求了