如何设置跨域
最后更新于:2022-04-02 07:08:04
## 如何设置跨域
框架骨架提供了现成的跨域中间件代码,用户只需将该中间件配置到路由规则中即可实现跨域:
- 中间件源码:
[>> \App\Web\Middleware\CorsMiddleware::class <<](https://github.com/mix-php/mix-skeleton/tree/v2.1/app/Web/Middleware/CorsMiddleware.php)
- 在路由类依赖配置中设置中间件:
- [beans/route.php](https://github.com/mix-php/mix-skeleton/tree/v2.1/manifest/beans/route.php)
';