//获取access_token
getAccessToken(){
let that=this;
let appid="小程序的appid";
let secret="小程序的密钥";
wx.request({
url: `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${appid}&secret=${secret}`,
header: {
'content-type': 'application/json'
},
success(res) {
console.log("at微信小程序"+res.data.access_token)
},
fail(error){
console.log(error)
}
})
},
小程序获取access_token
最新推荐文章于 2024-02-24 17:48:04 发布