之前项目(前后端分离)是在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.
有什么办法解决吗????
子衿沉夜
白板的微信
慕妹3242003