前端能正常访问图片,但无法下载
因为路径不经过业务代码,所以需要在nginx配置跨域
代码:
bash
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
add_header Access-Control-Expose-Headers 'Content-Disposition';