workerman php 跨域头设置

时间:2022-08-28 15:56:59
       Http::header("Access-Control-Allow-Origin: *"); // 允许任意域名发起的跨域请求  
       Http::header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');

       Http::header('Access-Control-Allow-Methods: GET, POST, PUT,OPTIONS');


一定要允许OPTIONS请求