日志内容 Request ID: 78760258-abde-11e9-a24c-525400b2c41b
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database();
const got = require("got")
const APPID = "wx6ff71b78dbf5b9db"
const APPSECRET = "0174ffa84fc7271cea408e1e6ac1e6e2"
const TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APPID + "&secret=" + APPSECRET
const CHECK_URL = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token="
// 云函数入口函数
exports.main = async(event, context) => {
const content = event.content;
const tokenResp = await got(TOKEN_URL);
const tokenBody = JSON.parse(tokenResp.body);
const token = tokenBody.access_token;
const checkResp = await got(CHECK_URL + token, {
body: JSON.stringify({
content: content
})
});
const checkBody = JSON.parse(checkResp.body);
console.log(checkBody);
}
相似问题