Ionic 可以做到无视 CORS 吗

2015-05-07 16:21:52 +08:00
 pandada8

文档似乎说可以啊……然而我在我的 MIUI 上并没有试验成功……
顺便服务端不可控而且对源 IP 敏感……

7608 次点击
所在节点    Ionic
4 条回复
clker
2015-05-07 17:55:55 +08:00
你可以先搜索下吗
pandada8
2015-05-07 20:08:36 +08:00
@clker
Running on a device
What happens when you run ionic run?

Your files for the app are copied to the device (or simulator).
The app runs, thus firing a browser on the phone/simulator to run the files that were copied over, something like: file://some/path/www/index.html.
Your origin will not exist, since you are running off of a file:// URI; therefore, any request outwards will not require a CORS request.
然而我没开任何的live reload,在设备上和模拟器都无法发请求
xylitolLin
2015-05-07 23:20:57 +08:00
把那个<meta access-orgin......>(忘了具体是什么),删了不行吗?
wangxiao2015
2015-06-17 20:49:11 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/189223

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX