From c4143d291e70b3ccff023a5a3e09f49889f5daa0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 十一月 2023 21:48:34 +0800 Subject: [PATCH] 2023-11-03 --- src/menu/datasource/verifycard/settingform/index.jsx | 60 ++++-------------------------------------------------------- 1 files changed, 4 insertions(+), 56 deletions(-) diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index a97fa31..5f5d523 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -5,8 +5,8 @@ import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import KeyInterface from '@/components/keyInterface' import './index.scss' @@ -108,56 +108,9 @@ // 鏁版嵁婧愬墠绔獙璇� if (values.interType === 'system' && values.execute !== '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 } @@ -521,12 +474,7 @@ </Form.Item> </Col> : null} {config.pageable && setting.laypage !== 'false' ? <Col span={8}> - <Form.Item label={ - <Tooltip placement="topLeft" title="閫夋嫨鍒嗛〉鏃舵湁鏁堛��"> - <QuestionCircleOutlined className="mk-form-tip" /> - 姣忛〉鏁伴噺 - </Tooltip> - }> + <Form.Item label="姣忛〉鏁伴噺"> {getFieldDecorator('pageSize', { initialValue: setting.pageSize || 10, rules: [ -- Gitblit v1.8.0