refactor(install): 优化安装脚本配置逻辑

- 提取 Nginx 检测为独立函数 isNginxInstalled
- 为 select 函数添加 defaultIndex 参数支持默认选项
- 数据库配置保留用户上次输入值作为默认值
- 运行环境和部署方式选择支持记忆上次配置
This commit is contained in:
zhang1106
2026-05-09 16:30:21 +08:00
parent 7f4602d465
commit 3f34098635
4 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -403,7 +403,7 @@ async function checkEnvironment() {
}
}
if (commandExists('nginx') || commandExists('nginx.exe')) {
if (isNginxInstalled()) {
log.success('Nginx 已安装');
} else {
log.warning('未检测到 Nginx(可选,仅在使用Nginx部署时需要)');