From 5c668c057e3349c27627c55e7bc98ab355b3b27b Mon Sep 17 00:00:00 2001 From: zhengzhou Date: Wed, 14 Apr 2021 18:55:37 +0800 Subject: [PATCH] =?UTF-8?q?system.updateFile=E4=B8=AD=E6=B7=BB=E5=8A=A0ver?= =?UTF-8?q?sion=E5=AD=97=E6=AE=B5=E4=BC=A0=E5=80=BC;=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=89=88=E6=9C=AC=E6=97=B6=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=E5=85=A5=E5=8F=A3;file-item?= =?UTF-8?q?=E4=B8=AD=E6=9B=B4=E6=8D=A2=E5=8D=8F=E5=90=8C=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/system.js | 6 ++++-- src/views/main_web/workspace/components/commit-judge.vue | 7 ++++--- src/views/main_web/workspace/components/file-item.vue | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/services/system.js b/src/services/system.js index f4659bbd..cfaada6c 100644 --- a/src/services/system.js +++ b/src/services/system.js @@ -647,7 +647,7 @@ const system = { const progressData = JSON.parse(e.data); console.log('progressData') //如果是选择别人的版本进行提交 这里的historyCurrentIpfsCid 就不是websocket返回的 而是文件自身的ipfscid - const { size, process, hash, commitHistoryHash } = progressData; + const { size, process, hash, commitHistoryHash, version } = progressData; onProgressHandler(progressData); if(process !== 100 || !hash) return; socket.close(); @@ -659,6 +659,7 @@ const system = { if(!isConflict) { // 选择本地文件为服务器最新commit copyFile.Size = +size; copyFile.IpfsCid = hash; + copyFile.Version = version; } // const copyFile = firstCharToUpperCase({ ...file, size: +size, ModifyUserId: sessionStorage.userId, // historyCurrentIpfsCid: commitHistoryHash, @@ -670,8 +671,9 @@ const system = { wrapErrorHint(res); // if(res.Code === 0) { notify.success(`${archName} 更新成功`); } if(isConflict) { // 若选择远端文件为服务器最新commit, 则输出回本地的copyFile需要将ipfsCid换成本地提交的commit - copyFile.IpfsCid = hash; copyFile.Size = +size; + copyFile.IpfsCid = hash; + copyFile.Version = version; } onSuccessHandler(copyFile); return; diff --git a/src/views/main_web/workspace/components/commit-judge.vue b/src/views/main_web/workspace/components/commit-judge.vue index 0fbd37d3..f42d227d 100644 --- a/src/views/main_web/workspace/components/commit-judge.vue +++ b/src/views/main_web/workspace/components/commit-judge.vue @@ -24,7 +24,7 @@
-
+