收藏
回答

为啥security.msgSecCheck返回errCode一直都是0?

const cloud = require('wx-server-sdk')
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV,
})
exports.main = async (event, context) => {
      const wxContext = cloud.getWXContext()
  try {
   var result= await cloud.openapi.security.msgSecCheck({
        openid:wxContext.OPENID,
        scene3,
        version2,
        content:event.content
      })
      return result;
  } catch (err) {
      return err
  }
 }

click1(e) {
            let that=this;
            var desc=that.data.desc;
            console.log(desc);
            wx.cloud.callFunction({
                  name'check',
                  data: {
                        content: desc,
                  },
            }).then(res => {
               this.setData({
                     code:res.result.errCode
               })
               console.log("kmr",res)
               console.log("kmrihf",res.result.result.label)//label可以正常返回值但涉及辱骂,色情返回值为100涉及领导人为20001
            }).catch(res=>{
                  console.log('shibai',res)
            })
}
我是自学微信小程序云开发还有很多都不太懂还请各位大佬教授orz!!!!
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签