Access to XMLHttpRequest at 'http://oa.sdsoon.cn:8099/project/list?page=1&limit=20' from origin 'http://127.0.0.1:8020' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://127.0.0.1:8020, *', but only one is allowed.
出现这问题有可能是服务器端配置了跨域选项,在代码端也指定了跨域设置导致冲突,去掉一边的配置即可
例如:代码和nginx
代码中查看是不是配置:
header("Access-Control-Allow-Origin: *");
nginx配置有没有配置:
add_header Access-Control-Allow-Origin *;
这两个配置,只要保留一个即可。