\think\Route::bind('index');
由于我这个小项目是单一模块,所以我就用这种方式进行绑定来简化url,结果,登录页面的验证码图片就不能显示了,并且提示如下,只要把这个注释掉验证码又能出来。控制器不存在 :captcha
$request->controller($controller)->action($actionName);
// 监听module_init
Hook::listen('module_init', $request);
try {
$instance = Loader::controller($controller, $config['url_controller_layer'], $config['controller_suffix'], $config['empty_controller']);
// dump($instance);
if (is_null($instance)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
// 获取当前操作名
$action = $actionName . $config['action_suffix'];
if (!preg_match('/^[A-Za-z](\w)*$/', $action)) {
// 非法操作
throw new \ReflectionException('illegal action name:' . $actionName);
}
// 执行操作方法
最佳答案
