Ver Fonte

服务监控增加重放

xusl há 1 ano atrás
pai
commit
0c5410218a

+ 2 - 0
backend/src/main/java/com/jiayue/ssi/controller/ServerController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ssi.controller;
 
+import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.Server;
 import com.jiayue.ssi.util.ResponseVO;
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
 public class ServerController {
     @PreAuthorize("@ss.hasPermi('monitor:server:list')")
     @GetMapping()
+    @PreventReplay
     public ResponseVO getInfo() throws CustomException {
         try {
             Server server = new Server();

+ 17 - 6
ui/src/views/monitor/server/index.vue

@@ -302,7 +302,6 @@
 </template>
 
 <script>
-import {getServer} from "@/api/monitor/server";
 
 export default {
   name: "Server",
@@ -318,11 +317,23 @@ export default {
   },
   methods: {
     /** 查询服务器信息 */
-    getList() {
-      getServer().then(response => {
-        this.server = response.data;
-        // this.$modal.closeLoading();
-      });
+    async getList() {
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
+      var searchParams = {
+        sysTime: sysTime,
+        lk: lk
+      }
+      await this.$axios.get('/monitor/server',{params: searchParams}).then((res) => {
+        this.server = res.data;
+      }).catch((error) => {
+        // this.$message.error(error)
+      })
     },
     // 打开加载层
     openLoading() {