lumen 框架vue option请求跨域
各种调跨域都不好使 最后是因为 option需要在路由中配置
在路由文件中
<?php
use Illuminate\Http\Request;
/** @var \Laravel\Lumen\Routing\Router $router */
$router->group(['middleware' => 'cross'], function () use ($router) {
$router->options('{all}', function (Request $request) {
});
$router->options('{all}/{allMethod}', function (Request $request) {
});
$router->options('v1/{all}/{allMethod}', function (Request $request) {
});
$router->options('fs/{all}/{allMethod}', function (Request $request) {
});
});