webview里面调用获取临时素材API跨域问题
发布于 5 年前 作者 linmin 7923 次浏览 来自 问答

webview里面调用weixin-js-sdk,调用https://api.weixin.qq.com/cgi-bin/media/get 接口,在浏览器中可以正常使用,但到小程序里面就会报跨域问题。望大神解答。

Fetch API cannot load https://api.weixin.qq.com/cgi-bin/media/get?access_token=11_w1dF2wOJERog6NPDHeCcCOYmL-9_neR-jJBv6zzZ4gljhd2MWWoZa3m-zSIO-SkrnYUDxZql8sV2s4_eFJEnSsu4wNlVSq2Arb3svcKpEQXNazOPRiUVLqUz3qPsaOv4sY-Ux1qLoH1M7dt5KBFaAGAPGK&media_id=Ute3a5wXwGSrRRQStY0zer63gbywXUVQepWVPTqQMe3kjnG2fLUe322Z6rpscv6m. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://sitdemo.greenlandfs.com’ is therefore not allowed access. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

1 回复

webview就是个浏览器,肯定有跨域问题,这难道不应该放在后端去处理吗?

回到顶部