From 20185ab64a165df51515d9fa1c9b12a7a8c55f59 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 07 四月 2023 23:11:04 +0800
Subject: [PATCH] 2023-04-07

---
 src/menu/datasource/verifycard/index.jsx |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 814c6df..a8e1e0f 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -4,6 +4,7 @@
 import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button, Input } from 'antd'
 import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons'
 import moment from 'moment'
+import md5 from 'md5'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -33,6 +34,7 @@
 
   state = {
     columns: [],
+    debugId: '',
     subColumns: [],
     activeKey: 'setting',
     loading: false,
@@ -653,7 +655,7 @@
   }
 
   sqlverify = (resolve, reject, change = false, testScripts) => {
-    const { columns, setting, scripts, searches, defaultSearch } = this.state
+    const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state
 
     let _scripts = scripts.filter(item => item.status !== 'false')
 
@@ -678,6 +680,13 @@
     if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) {
       let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
       let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp)
+
+      let _debugId = md5(r.sql)
+
+      if (debugId === _debugId) {
+        resolve()
+        return
+      }
 
       if (r.errors) {
         notification.warning({
@@ -713,6 +722,7 @@
           if (sumParam) {
             Api.genericInterface(sumParam).then(res => {
               if (res.status) {
+                this.setState({debugId: _debugId})
                 resolve()
               } else {
                 reject()
@@ -722,6 +732,7 @@
               }
             })
           } else {
+            this.setState({debugId: _debugId})
             resolve()
           }
         } else {

--
Gitblit v1.8.0