之前项目(前后端分离)是在apache服务器上 验证码和获取数据一切都正常!
后来切换成nginx服务器 结果图形验证码死活是不能验证!但是获取数据和提交数据是没毛病的!
之后就在服务器配置中配置
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
配置完毕之后别说验证码了 就连获取数据都提示
Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:9080, *', but only one is allowed. Origin 'http://localhost:9080' is therefore not allowed access.
有什么办法解决吗????
- 5 回答
- 0 关注
- 2824 浏览
添加回答
举报
0/150
提交
取消