前端请求后端接口没问题,但是装了 pdfjs-dist 组件后,请求后端 pdf 地址提示跨域问题? 通过各种搜索,我在后端加了 header 允许的域名,但是提示 Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values ', *', but only one is allowed. 请问怎么解决呀
1
xiaxueme OP 前端 vue ,后端 php laravel
|
2
taogen 2023-09-15 21:57:43 +08:00 via Android
Access-Control-Allow-Origin 制定 IP 或域名,不要用 *。或者去掉"Access-Control-Allow-Credentials", "true"。
|