改进 复制方便,每次启动都重置 NODE_ID

This commit is contained in:
iVampireSP.com 2023-01-05 02:42:58 +08:00
parent c9c65aaafe
commit 76acbaea49
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -38,8 +38,7 @@ public function handle(): int
return CommandAlias::FAILURE; return CommandAlias::FAILURE;
} }
// if not node_id
if (!config('settings.node.id')) {
// 重写 .env 文件中的 NODE_ID // 重写 .env 文件中的 NODE_ID
$this->info('正在重写 .env 文件中的 NODE_ID。'); $this->info('正在重写 .env 文件中的 NODE_ID。');
@ -54,7 +53,6 @@ public function handle(): int
$env = preg_replace('/^NODE_ID=.*$/m', 'NODE_ID=' . $node_id, $env); $env = preg_replace('/^NODE_ID=.*$/m', 'NODE_ID=' . $node_id, $env);
file_put_contents(base_path('.env'), $env); file_put_contents(base_path('.env'), $env);
}
// 刷新配置缓存 // 刷新配置缓存