收藏
回答

真机调试中调用onCameraFrame里无法执行wx.request?

微信版本: 7.0.8

手机型号:iPhone6s  iOS13.1.2

调试库版本:2.9.3

在微信开发者工具中可以正常运行,但是在真机环境下,onCameraFrame中无法执行wx.request方法

代码:

const context = wx.createCameraContext()
this.listener = context.onCameraFrame((frame) => {
wx.request({
url: 'https://www.xxxxxx.com/api',
   method: 'GET',
   header: {
     'content-type': 'application/json' // 默认值
 },
   success(res) {
console.log('Request success!');
},
   fail(err) {
console.log(err);
   }
});
});


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签