🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 跨域请求 ``` <?php namespace app\api\controller; use think\Controller; class Bass extends Controller { protected function initialize() { parent::initialize(); header(string:Access-Control-Allow-Origin:*); header(string:Access-Control-Allow-Headers:Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With); header(string:Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS, PATCH); } } ```