1. ios12 系统跨域请求,状态码0
2. 原因:跨域请求options中请求头缺少参数
请求头信息 Access-Control-Request-Headers: accept, content-type, origin
3. nginx反向代理的解决方法:判断是optinos,添加参数Origin,Accept
if ($request_method = 'OPTIONS') { add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Headers 'Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,Origin,Accept,X-Token,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,tenant'; add_header Access-Control-Allow-Credentials 'true'; add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS; return 204; }