From 7cb4669c2f6eda51acd62624a146c1efb0d3a8c3 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期二, 14 六月 2022 15:24:56 +0800
Subject: [PATCH] 拖拽算法版本不匹配

---
 vue.config.js                          |    4 ++--
 src/views/hashrate/AlgManage/index.vue |   26 +++++++++++++++-----------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/views/hashrate/AlgManage/index.vue b/src/views/hashrate/AlgManage/index.vue
index ccfe505..3053435 100644
--- a/src/views/hashrate/AlgManage/index.vue
+++ b/src/views/hashrate/AlgManage/index.vue
@@ -20,7 +20,7 @@
       <div class="label freeLabel">
         鍏嶈垂绠楁硶 <span class="des">浠庢澶勬嫋鎷界畻娉曞浘鏍囧畨瑁呭埌璁惧</span>
       </div>
-      <div class="freeList">
+      <div class="freeList scroll">
         <div
           class="algCard"
           v-for="(item, index) in freeAlg"
@@ -210,17 +210,21 @@
         sdk_name: this.dragAlg.productName,
       });
 
-      const res = await downloadOrUpgrade({
-        nodeId: devId,
-        path: this.dragAlg.productBaseId,
-        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
-        inputText: this.dragAlg.productName,
-      });
-      if (res && res.success) {
-        this.$notify({
-          type: "success",
-          message: "鎿嶄綔鎴愬姛,璇风◢鍚�",
+      try {
+        const res = await downloadOrUpgrade({
+          nodeId: devId,
+          path: this.dragAlg.productBaseId,
+          userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
+          inputText: this.dragAlg.productName,
         });
+        if (res && res.success) {
+          this.$notify({
+            type: "success",
+            message: "鎿嶄綔鎴愬姛,璇风◢鍚�",
+          });
+        }
+      } catch (err) {
+        algArr.pop();
       }
 
       this.dragAlg = null;
diff --git a/vue.config.js b/vue.config.js
index 8385a1b..75d9f3a 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -14,8 +14,8 @@
     proxy: {
       "/api": {
         // target: "http://192.168.20.10:7004",
-        target: "http://192.168.20.174:7070",
-        // target: "http://192.168.20.235:7070",
+        // target: "http://192.168.20.174:7070",
+        target: "http://192.168.20.235:7070",
         //  target: "http://192.168.20.117:7080",
         // secure: false,
         changeOrigin: true,

--
Gitblit v1.8.0