每次更改pages下的文件index中content中内容,就要重新部署云函数,否则就报错?
// 云函数入口函数
exports.main = async (event, context) => {
const content = event.content;
const tokenResponse = await got(tokenUrl);
const access_token = JSON.parse(tokenResponse.body).access_token;
checkUrl = checkurl+access-token;
const checkResponse = await got.post(checkUrl,{
body:JSON.stringify({
content:content
})
})
return checkResponse.body
}
// 文字内容安全监测
wx.cloud.callFunction({
name:"msgCheck",
data:{
content:"特3456书yuuo莞6543李zxcz蒜7782法fgnv级"
},
success:res =>{
console.log(res);
},
fail:err => {
console.error(err);
}
})