diff --git a/src/think/Console.php b/src/think/Console.php index 91af08b28d..1a90a1ccba 100644 --- a/src/think/Console.php +++ b/src/think/Console.php @@ -93,6 +93,12 @@ public function __construct(protected App $app) //加载指令 $this->loadCommands(); + // 设置执行用户 + $user = $this->app->config->get('console.user'); + if (!empty($user)) { + $this->setUser($user); + } + $this->start(); }