2

javascript 原生 fetch 在安卓微信内置浏览器无法请求 https

 3 years ago
source link: https://www.v2ex.com/t/796656
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  JavaScript

javascript 原生 fetch 在安卓微信内置浏览器无法请求 https

  sailgu · 1 天前 · 906 次点击

这个太神奇了,写好的页面在桌面浏览器正常,在微信开发者工具正常,一到手机上(指在手机微信里,下同)就不正常,折腾了半天,最后发现苹果手机上也好的。最后排查了半天才发现是 https 和 fetch 的原因。

代码里用到 fetch( https://url).then(funcA).then(funcB) 这么一句话。

这么写其他地方都好好的,就安卓微信里不行,把 https 改成 http 才能在安卓微信里正确运行。

萌新想问下大佬们,安卓为啥这么特殊,还是 fetch 本来就要少用?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK