宝塔面板跨域问题

如图所示

kuayu01

首先来到我们的宝塔面板,我们需要修改Nginx配置文件

kuayu02

需要添加的代码

add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,POST';
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';

添加完保存重启即可