From 91b1e1f060de380d5decfed7149d2f6d344d5eb6 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Mon, 08 Sep 2025 17:44:56 +0800
Subject: [PATCH] feat:更新算法功能
---
src/page/index/useDownloadWs.js | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/page/index/useDownloadWs.js b/src/page/index/useDownloadWs.js
index d39324d..2113b6d 100644
--- a/src/page/index/useDownloadWs.js
+++ b/src/page/index/useDownloadWs.js
@@ -15,9 +15,16 @@
let currentWebSocket = null
function messageHandler(payload) {
const {type,status,progress,download_url} = payload
- const setProgress = status === 'CANCELLED'
- ? 100
- : (status !== 'COMPLETED' && progress === 100) ? 99 : progress
+ let setProgress = 0
+ if (status === 'PENDING'){
+ setProgress = 1
+ }else if(status === 'CANCELLED'){
+ setProgress = 100
+ }else if(status !== 'COMPLETED' && progress === 100){
+ setProgress = 99
+ }else{
+ setProgress = progress
+ }
store.commit('setDownloadProgress', {
...downloadProgress.value,
[type]: setProgress,
--
Gitblit v1.9.3