thinkphp\library\think\route\dispatch\Module.php
// 模塊初始化
if ($module && $available) {
// 初始化模塊
$this->app['request']->module($module);
$this->app->init($module);
// 加載當前模塊語言包
$this->app['lang']->load($this->app->getAppPath() . $module . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . $this->app['request']->langset() . '.php');
// 模塊請求緩存檢查
$this->app['request']->cache(
$this->app->config('app.request_cache'),
$this->app->config('app.request_cache_expire'),
$this->app->config('app.request_cache_except')
);
} else {
header('Location:/404.html');die;//在此進行跳轉
throw new HttpException(404, 'module not exists:' . $module);}