webman路由问题:在config/route.php里定义一个路由规则到子应用的控制器方法是否可用?

vasileon

我使用了多应用目录设计
app下面有api应用,admin应用,app下面没有controller 只有2个子应用
app下面有全局配置 config/route.php

为何我在config/route.php 定义的 /test3 总是会匹配到 / 路由去?
以下是config/route.php内容


\Webman\Route::get('/', function(){
    return (new Response)->file(一个vue打包好的项目的index.html,在app/public目录下);
});

\Webman\Route::get('/test3', [\app\admin\controller\Index::class, 'index');
828 1 0
1个回答

owenzhang

你把结果也截图看看,不懂你说什么意思?

  • redsky 2022-12-10

    get('/', function(){},匹配所有路由了,所以应该放后面!

年代过于久远,无法发表回答
🔝