自建live2d看板娘API报错

邮箱助手截图20220121230628.png
跨域问题

解决方案 :

在Nginx配置文件加入下面代码加入下面代码,问题解决,当然还可以设置动态跨域!

 #设置允许全局跨域
 add_header Access-Control-Allow-Origin *;
 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'; 

Q.E.D.


I fight, so you don't have to.