我安装了composer require webman/cors 跨域插件
然后在 config/route.php 里所有接口都设置了 any
Route::any(..)
然后重新启动 webman 测试结果:
如果我在 config/route.php 头部增加了:
Route::options('[{path:.+}]', function (){
return response('');
});
然后重新启动 webman , 测试结果如下:
pending 很长时间后,最后变成:
这如何破??
直接安装这个插件就可以了, 不需要自己写
https://www.workerman.net/plugin/31
大神,我按照你的方法,上面的内容