看手册的时候发现的,可以避免一些冲突,手册还是要仔细看才好。
在这个application/route.php下面可以添加任何你想要设置的路由,真的很方便。我把验证码的路由也放到这个里面了。return [<br>
'__pattern__' => [<br>
'name' => '\w+',<br>
],<br>
'[hello]' => [<br>
':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],<br>
':name' => ['index/hello', ['method' => 'post']],<br>
],<br>
'captcha/[:id]' => ['\think\captcha\CaptchaController@index',['method'=>'get'], ['id' => '\d+']], /*验证码路由*/<br>
// 'captcha/[:id]' => '\think\captcha\CaptchaController@index', /*验证码路由*/<br>
'zxzx/index' => 'zxzx/zxzx/index',<br>
'admin/admin' => 'zxzx/admin/admin',<br>
'zxzx/add' => 'zxzx/zxzx/add',<br>
'zxzx/edit' => 'zxzx/zxzx/edit',<br>
'zxzx/del' => 'zxzx/zxzx/del',<br>
'admin/profile' => 'zxzx/admin/profile',<br>
'admin/logout' => 'zxzx/admin/logout',<br>
'user/login' => 'zxzx/user/login',<br>
'user/login_captcha' => 'zxzx/user/login_captcha',<br>
'user/index' => 'index/user/index',<br>
'user/create' => 'index/user/create',<br>
'user/add' => 'index/user/add',<br>
'user/add_list' => 'index/user/addList', <br>
'user/update/:id' => 'index/user/update',<br>
'user/delete/:id' => 'index/user/delete',<br>
'user/:id' => 'index/user/read',<br>
];