注意:使用promise回调函数

var that = this;
new Promise((resolve, reject) => {
console.log('进入Promise方法了');
request({
method: 'GET',
url: wx_gettoken_url
}, function(err, res, body) {
if (res) {
resolve({
isSuccess: true,
data: JSON.parse(body)
});
} else {
console.log (err);
reject({
isSuccess: false,
data: err
});
}
})
}).then(proData => {
that.getQrcode(proData);
});

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2022-02-26
  • 2021-07-06
  • 2022-01-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-08-25
  • 2022-01-09
相关资源
相似解决方案