这个access token 获取的不对
报错{\\\"errcode\\\":40001,\\\"errmsg\\\":\\\"invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 678f5de8-370a140c-15480bf0\\\"}\""}
self._dao.execute(
"select id,app_id,secret,comment from 数据库 "+orderByStr+" ", params,
function(rows, err) {
appid = rows[0].app_id;
secret = rows[0].secret;
grant_type = 'client_credential';
self.sendHttpRequest({
"urlPath": "https://api.weixin.qq.com/cgi-bin/token?grant_type="+grant_type+"&appid="+appid+"&secret="+secret+"",
"method": "get",
"retToJson": true,
"headers": {
}
},
function(reqHttp, resHttp, errHttp, retHttp) {
res.access_token = retHttp.access_token;
self.end(res);
});
self.sendHttpRequest({
"urlPath": "https://api.weixin.qq.com/wxa/sec/vod/pullupload?access_token=" + access_token,
"method": "post",
"headers": {
"Content-Type": "application/json"
}
,
"postdata": {
"media_name": media_name,
"media_url": self.url
}
},
function (reqHttp, resHttp, errHttp, retHttp) {
res.data = JSON.stringify(retHttp);
self.end(res);
// if (resHttp.errmsg == 'ok') {
// self.task_id = resHttp.task_id;
// self.timer = setInterval(self.check(req, res, self), 1000);
// } else {
// self.onLogicError(1, "上传失败");
// }
});
您好,可以参考文档自查下:https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/backend-api.html#access_token