level 1
水雨木树
楼主
var getAccessPermission = async(code)=> {
let url = API_TOKEN_GET + "appid=" + appId + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
console.log("getAccessTokenUrl:" + url);
return await requestUrl(url);
};
var requestUrl = async(url)=> {
//console.log("2232");
await httpRequest.get(url,function (err, httpResponse, body) {
if (err) {
reject();
console.log(err)
} else {
console.log("json", JSON.parse(body));
resolve();
return JSON.parse(body);
}
});
//var data = await httpRequest.get(url);
//if (data == null) {
// return null;
//}
//return resolve(JSON.parse(data));
};
2016年07月05日 07点07分
1
let url = API_TOKEN_GET + "appid=" + appId + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
console.log("getAccessTokenUrl:" + url);
return await requestUrl(url);
};
var requestUrl = async(url)=> {
//console.log("2232");
await httpRequest.get(url,function (err, httpResponse, body) {
if (err) {
reject();
console.log(err)
} else {
console.log("json", JSON.parse(body));
resolve();
return JSON.parse(body);
}
});
//var data = await httpRequest.get(url);
//if (data == null) {
// return null;
//}
//return resolve(JSON.parse(data));
};