From cec8944192be6e48740f3818a9a1364032de4f30 Mon Sep 17 00:00:00 2001 From: Alirea <2981883527@qq.com> Date: Mon, 15 Sep 2025 10:26:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=80=BB=E8=BE=91=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E4=BB=A3=E7=A0=81=E6=B2=A1=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=8D=E6=89=A7=E8=A1=8C=E4=BE=9D=E8=B5=96=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/initialization/AutoMode.vue | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/initialization/AutoMode.vue b/frontend/src/components/initialization/AutoMode.vue index 55e4e9a..ae8291d 100644 --- a/frontend/src/components/initialization/AutoMode.vue +++ b/frontend/src/components/initialization/AutoMode.vue @@ -132,24 +132,31 @@ async function startAutoProcess() { }, 2000) return } - } - // 无论是否有更新,都检查并安装依赖 - progressText.value = '检查并安装依赖包...' - progress.value = 60 + // 代码更新成功后,检查并安装依赖 + progressText.value = '检查并安装依赖包...' + progress.value = 60 - // 尝试安装依赖,支持镜像源重试 - const dependenciesSuccess = await tryInstallDependenciesWithRetry(config) - if (aborted.value) return + // 尝试安装依赖,支持镜像源重试 + const dependenciesSuccess = await tryInstallDependenciesWithRetry(config) + if (aborted.value) return - if (!dependenciesSuccess) { - // 所有PIP镜像源都失败了,显示重新配置按钮 - progressText.value = '依赖安装失败,所有PIP镜像源均无法访问' - progressStatus.value = 'exception' - setTimeout(() => { - progressText.value = '请点击下方按钮重新配置环境' - }, 2000) - return + if (!dependenciesSuccess) { + // 所有PIP镜像源都失败了,显示重新配置按钮 + progressText.value = '依赖安装失败,所有PIP镜像源均无法访问' + progressStatus.value = 'exception' + setTimeout(() => { + progressText.value = '请点击下方按钮重新配置环境' + }, 2000) + return + } + } else { + // 没有更新,跳过依赖安装,直接设置进度 + console.log('代码没有更新,跳过依赖安装阶段') + progressText.value = '代码无需更新,跳过依赖安装...' + progress.value = 60 + // 短暂延迟以显示跳过信息 + await new Promise(resolve => setTimeout(resolve, 1000)) } progressText.value = '启动后端服务...'