调用微信官方api
请问想要调用微信官方的api,自己没有服务器,应该如何做呢?
比如我想调用微信官方的文本敏感内容检测的api,
我想调用这段代码:
wx.request({
url: ‘https://api.weixin.qq.com/cgi-bin/token?grant\_type=client\_credential&appid=your app id&secret=your secret’,
method: ‘GET’,
success: res => {
var access_token = res.data.access_token;
wx.request({
method: ‘POST’,
url: ‘https://api.weixin.qq.com/wxa/msg\_sec\_check?access\_token=${access\_token}’,
data: {
content: me.data.title
},
success(res) {
console.log(“文本检测res.errcode=” + res.errcode)
if (res.errcode !== 87014) { // 合格
}
}
})
},
fail() {
console.log(res);
}
})
又提示有错误:
如若已在管理后台更新域名配置,请刷新项目配置后重新编译项目,操作路径:“详情-域名信息”
VM3935:1 https://api.weixin.qq.com 不在以下 request 合法域名列表中,请参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html
