搞代码搞不通,直接在IIS 、Nginx 添加
IIS HTTP响应标头 添加
Access-Control-Allow-Headers 值 * Access-Control-Allow-Methods 值 OPTIONS,POST,GET Access-Control-Allow-Origin 值 *
Nginx
location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers '*'; }
代码里去掉header里这三项,避免重复错误
标签:Control,跨域,header,Access,访问,add,Allow,OPTIONS From: https://www.cnblogs.com/yingshiyu/p/16753391.html