瀏覽代碼

告警信息重放

xusl 1 年之前
父節點
當前提交
6ef502d1f8

+ 3 - 0
backend/src/main/java/com/jiayue/ssi/controller/SysAlarmController.java

@@ -2,6 +2,7 @@ package com.jiayue.ssi.controller;
 
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.SysAlarm;
 import com.jiayue.ssi.service.SysAlarmService;
@@ -31,6 +32,7 @@ public class SysAlarmController {
      * @return
      */
     @GetMapping(value = "/getAll")
+    @PreventReplay
     public ResponseVO getAll() throws CustomException {
         try {
             QueryWrapper<SysAlarm> wrapper = new QueryWrapper<>();
@@ -46,6 +48,7 @@ public class SysAlarmController {
      * 查收提交
      */
     @PostMapping(value = "/readDone")
+    @PreventReplay
     public ResponseVO readDone(String id) throws CustomException {
         try {
             Long commitid;

+ 25 - 5
ui/src/layout/components/Navbar.vue

@@ -240,11 +240,20 @@ export default {
     /**
      * 删除提交
      */
-    readDone:debounce(function(row){
+    readDone:debounce(async function(row){
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
       const param = {
-        id: row.id
+        id: row.id,
+        sysTime: sysTime,
+        lk: lk
       }
-      this.$axios.post('/sysAlarmController/readDone', param).then((res) => {
+      await this.$axios.post('/sysAlarmController/readDone', param).then((res) => {
         if (res.code == 0) {
           this.$message({
             type: 'success',
@@ -269,10 +278,21 @@ export default {
       this.getAlarmData()
       this.open = false
     },
-    getAlarmData(){
+    async getAlarmData(){
+      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
+      }
       this.loading = true
       // 查询告警消息
-      this.$axios.get('/sysAlarmController/getAll').then((res) => {
+      await this.$axios.get('/sysAlarmController/getAll',{params: searchParams}).then((res) => {
         this.alarmList = res.data
         if (res.data.length>0){
           // 改变消息图标