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,
scene: 3,
version: 2,
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)
}).catch(res=>{
console.log('shibai',res)
})
}
我是自学微信小程序云开发还有很多都不太懂还请各位大佬教授orz!!!!
为啥不是0呢