Prechádzať zdrojové kódy

feat: 重启移动云主机

caoliqin 1 týždeň pred
rodič
commit
156610a5b6
2 zmenil súbory, kde vykonal 41 pridanie a 2 odobranie
  1. 11 0
      src/api/qw/user.js
  2. 30 2
      src/views/qw/user/index.vue

+ 11 - 0
src/api/qw/user.js

@@ -349,3 +349,14 @@ export function getQwUserListLikeName(params) {
     params: params
   })
 }
+
+/**
+ * 企业微信员工账号 解除绑定 云主机
+ */
+export function qwRestartCloudHost(params) {
+  return request({
+    url: '/qw/user/restartHost',
+    method: 'put',
+    params: params
+  })
+}

+ 30 - 2
src/views/qw/user/index.vue

@@ -222,6 +222,16 @@
           >
             解除主机
           </el-button>
+          <el-button
+            v-if="scope.row.loginCodeUrl!=null"
+            size="mini"
+            type="text"
+            icon="el-icon-thumb"
+            plain
+            @click="handleRestartCloudHost(scope.row)"
+          >
+            重启
+          </el-button>
         </template>
       </el-table-column>
       <el-table-column label="AI客服" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
@@ -412,7 +422,7 @@ import {
   loginQwCodeUrl,
   getLoginQwStatus,
   handleAllocateRemoteHost,
-  qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP
+  qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, qwRestartCloudHost
 } from '@/api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
 import {updateSop, updateSopQwUser} from "@/api/qw/sop";
@@ -778,7 +788,25 @@ export default {
       })
 
     },
-
+    handleRestartCloudHost(val){
+      console.log(val.loginCodeUrl);
+      this.$confirm(
+        '谨慎操作,是否确定要重启云主机?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return qwRestartCloudHost({"serverIp": val.loginCodeUrl});
+      }).then(response => {
+        this.$message.success('重启成功');
+      }).finally(res=>{
+        this.getList();
+      })
+    },
 
     handleAuthorizeKey(val){
       this.authorizeKeyFrom.id=val.id;