CORS policy: Request header field passstatic is not allowed by Access-Control-Allow-Headers in preflight response
1,在springboot项目中,加入了注解,
@CrossOrigin,
无用,
2,之后添加nginx配置,
add_header Access-Control-Allow-Origin *;
ccess-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept";
add_header Access-Control-Allow-Methods GET,POST,PUT,OPTIONS;
无用
3,最后修改成
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods GET,POST,PUT,OPTIONS;
OK