app\middleware.php

<?php
// 全局中间件定义文件
return [
    // 跨域请求
    \think\middleware\AllowCrossDomain::class
];