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

ThinkPHP 8.1.2使用多模块URL自动解析后MISS路由功能无效 #3125

Open
Rodots opened this issue Feb 27, 2025 · 0 comments
Open

ThinkPHP 8.1.2使用多模块URL自动解析后MISS路由功能无效 #3125

Rodots opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@Rodots
Copy link
Contributor

Rodots commented Feb 27, 2025

所属功能组件

路由(Route)

ThinkPHP 版本

8.1.2

操作系统

Windows

错误信息

使用8.1+版本开始支持的多模块URL自动解析功能,并定义全局MISS路由

Route::miss(function() {
    return '404 Not Found!';
});

Route::auto();
  • 假设app/controller/admin/Fake.php不存在
  • 访问http://localhost/admin/fake
  • 预期返回404 Not Found!
  • 实际会抛出错误控制器不存在:app\controller\admin\Fake

以上场景,如将Route::auto();移除,MISS路由功能将恢复正常工作,会按预期返回404 Not Found!

HttpException in D:\www\test\vendor\topthink\framework\src\think\route\dispatch\Controller.php line 85

@Rodots Rodots added the bug label Feb 27, 2025
@Rodots Rodots changed the title ThinkPHP 8.1.2使用多模块URL自动解析或路由分组绑定到控制器分级后MISS路由功能无效 ThinkPHP 8.1.2使用多模块URL自动解析后MISS路由功能无效 Feb 27, 2025
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

1 participant