多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
一、在Think[php](https://www.oschina.net/p/php)5入口文件public/index.[php](https://www.oschina.net/p/php),添加如下代码即可解决。 header("Access-Control-Allow-Origin:\*"); header("Access-Control-Allow-Methods:GET, POST, OPTIONS, DELETE"); header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding"); 二、index.[php](https://www.oschina.net/p/php)中的实际代码: ![](https://oscimg.oschina.net/oscnet/up-ab3d0a0b574119f184e416c1be130939c7c.png)