diff --git a/library/think/App.php b/library/think/App.php index 6a5b669f..6120a7b0 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -32,12 +32,14 @@ class App /** * 执行应用程序 * @access public - * @param \think\Request $request Request对象 + * @param null|\think\Request $request Request对象 * @return mixed * @throws Exception */ - public static function run($request) + public static function run($request = null) { + is_null($request) && $request = Request::instance(); + // 初始化应用(公共模块) $config = self::initModule(COMMON_MODULE, Config::get()); diff --git a/start.php b/start.php index 9ad4264e..5ad6f069 100644 --- a/start.php +++ b/start.php @@ -64,5 +64,5 @@ if (APP_HOOK && isset($mode['tags'])) { // 是否自动运行 if (APP_AUTO_RUN) { - App::run(Request::instance()); + App::run(); }