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

8.1 路由异常 #3112

Open
FlameMida opened this issue Jan 23, 2025 · 3 comments
Open

8.1 路由异常 #3112

FlameMida opened this issue Jan 23, 2025 · 3 comments
Labels

Comments

@FlameMida
Copy link

所属功能组件

路由(Route)

ThinkPHP 版本

8.1.2

操作系统

debian/mac/windows

错误信息

Route::group(function () {

    Route::get('index', 'v1.PublicController/index')->name('index')->option(['real_name' => '首页']);

  
    Route::get('user/xxx', 'v1.user.UserController/xxx')->name('xxx')->option(['real_name' => 'xxx']);
    
    Route::group(function () {
        Route::get('user/member/card/index', 'v1.user.MemberCardController/index')->name('userMemberCardIndex');
    });

    Route::group(function () {
        Route::get('bb/bb', 'v1.user.bbb/bb')->name('bb')->option(['real_name' => 'bbb']);
    });
});

user/member/card/index 上面的路由都可以正常访问,下面的路由全都404 把 bb/bb 放到 user/member/card/index 上面后 bb/bb 可以正常访问 bb/bb 下面的404了

其它说明

No response

@FlameMida FlameMida added the bug label Jan 23, 2025
@FlameMida
Copy link
Author

  Route::group('coupons', function () {
        Route::get('/user', 'UserCouponsController/user')->name('couponsUser');

        Route::post('/usable', 'UserCouponsController/usable')->name('couponsUsable');
    })->prefix('v1.user.');

使用prefix后整个路由组也会404

@liu21st
Copy link
Member

liu21st commented Jan 23, 2025

你这种路由定义 后面的是执行不到的 不管哪个版本都一样 和8.1无关

@FlameMida
Copy link
Author

8.0.4可以用啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants