🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# thinkphp跨域的解决办法 在入口文件 index.php 中添加如下代码 ``` <pre class="calibre13">``` <span class="token3">header</span><span class="token1">(</span><span class="token4">"Access-Control-Allow-Origin: *"</span><span class="token1">)</span><span class="token1">;</span> <span class="token3">header</span><span class="token1">(</span><span class="token4">"Access-Control-Allow-Methods: GET, POST"</span><span class="token1">)</span><span class="token1">;</span> <span class="token3">header</span><span class="token1">(</span><span class="token4">"Access-Control-Allow-Headers: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With"</span><span class="token1">)</span><span class="token1">;</span> ``` ``` ![](https://img.kancloud.cn/f6/24/f62427e3dbc0530c5000f933759f8790_713x306.png)