Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分组路由下,为子路由单独设置中间件失效 #2959

Open
zwh123214 opened this issue Dec 2, 2023 · 0 comments
Open

分组路由下,为子路由单独设置中间件失效 #2959

zwh123214 opened this issue Dec 2, 2023 · 0 comments
Labels
Route think\Route

Comments

@zwh123214
Copy link

PHP环境:PHP Version 8.3.0
框架版本:ThinkPHP 8.0.3

是在多应用模式下与强路由模式下发现,单应用还没尝试

Route::group("login",function () {

Route::post('login', "login");
Route::post('logout', "logout");

// 正常走中间件
Route::rule('getRuleList', "getRuleList")->middleware(Auth::class);

// 不走中间件
Route::post('getRuleList', "getRuleList")->middleware(Auth::class);
Route::rule('getRuleList', "getRuleList",'POST')->middleware(Auth::class);

})->prefix('Login/');

@big-dream big-dream added the Route think\Route label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Route think\Route
Projects
None yet
Development

No branches or pull requests

2 participants