fetch请求方式报错
chenchenyuyu opened this issue · 1 comments
chenchenyuyu commented
Uncaught (in promise) TypeError: Failed to execute 'json' on 'Response': body stream is locked
kissshot commented
我也碰到这个问题了, fetch的res只能调用一次text或者json之类的方法, sdk这里调了一次res.text(), res.body就被lock了。。。 希望作者能解决一下
return _fetch.apply(this, arguments) .then((res) => { if (result.type === 'report-data') return; getFetchTime('success') try { const url = res.url ? res.url.split('?')[0] : ''; res.text().then(data => { if (conf.ajaxMsg[url]) conf.ajaxMsg[url]['decodedBodySize'] = data.length; }) } catch (e) { } return res })