vue ios axios https请求 status 0

现象:

在ios手机或者webview中,请求接口直接返回status 0,在android和pc浏览器都正常。

解决方案:

后端接口将 Access-Control-Allow-Headers: *

完整配置自定义请求头 比如 token

Access-Control-Allow-Headers: accept, content-type, origin,token

一定要将头补充完整

用心写代码,不辜负程序员之名。
原文地址:https://www.cnblogs.com/thinkingthigh/p/14639723.html