centos7.9 php8 webmen 1.3.14
Route::group('/luckysheet', function () {
Route::post('/load', [app\controller\Api\LuckysheetController::class, 'load']);
Route::post('/updateImg', [app\controller\Api\LuckysheetController::class, 'updateImg']);
Route::post('/loadsheet', [app\controller\Api\LuckysheetController::class, 'loadsheet']);
})->middleware([app\middleware\CrossDomain::class]);
Route::group('/luckysheet', function () {
Route::group('/api', function () {
Route::post('/load', [app\controller\Api\LuckysheetController::class, 'load']);
Route::post('/updateImg', [app\controller\Api\LuckysheetController::class, 'updateImg']);
Route::post('/loadsheet', [app\controller\Api\LuckysheetController::class, 'loadsheet']);
});
})->middleware([app\middleware\CrossDomain::class]);
多层分组导致中间 app\middleware\CrossDomain::class 附加属性
$request->data = 'some value';
但是控制器无法获取到,
如果写在内层可以获取到
Route::group('/luckysheet', function () {
Route::group('/api', function () {
Route::post('/load', [app\controller\Api\LuckysheetController::class, 'load']);
Route::post('/updateImg', [app\controller\Api\LuckysheetController::class, 'updateImg']);
Route::post('/loadsheet', [app\controller\Api\LuckysheetController::class, 'loadsheet']);
})->middleware([app\middleware\CrossDomain::class]);
});
这个算是bug吗?
手册有写,要放内层