From ab949bb71eadda3ec1736ccdcfaa1b12b04cce6a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 05 十一月 2023 10:35:56 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx |   53 +++--------------------------------------------------
 1 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
index 6ac9645..064c117 100644
--- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
+++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
@@ -4,7 +4,7 @@
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import { formRule } from '@/utils/option.js'
-import Utils from '@/utils/utils.js'
+import { checkSQL } from '@/utils/utils-custom.js'
 import CodeMirror from '@/templates/zshare/codemirror'
 // import './index.scss'
 
@@ -73,56 +73,9 @@
             reject()
             return
           } else if (values.interType === 'system' && values.default !== 'false' && values.dataresource) {
-            let _quot = values.dataresource.match(/'{1}/g)
-            let _lparen = values.dataresource.match(/\({1}/g)
-            let _rparen = values.dataresource.match(/\){1}/g)
+            let pass = checkSQL(values.dataresource)
 
-            _quot = _quot ? _quot.length : 0
-            _lparen = _lparen ? _lparen.length : 0
-            _rparen = _rparen ? _rparen.length : 0
-
-            if (_quot % 2 !== 0) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (_lparen !== _rparen) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (/--/ig.test(values.dataresource)) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (/,,/ig.test(values.dataresource)) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�',
-                duration: 5
-              })
-              reject()
-              return
-            }
-
-            let error = Utils.verifySql(values.dataresource)
-
-            if (error) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error,
-                duration: 5
-              })
+            if (!pass) {
               reject()
               return
             }

--
Gitblit v1.8.0