From 46fa548514ba2a438908586e2b54ed742777e9b0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 08 六月 2020 18:09:11 +0800 Subject: [PATCH] 2020-06-08 --- src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 8c3361a..15cb953 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -210,6 +210,37 @@ reject() return } else if (values.interType === 'inner' && !values.innerFunc && 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) + + _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 + }) + return + } else if (_lparen !== _rparen) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', + duration: 5 + }) + return + } else if (/--/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', + duration: 5 + }) + return + } + let error = Utils.verifySql(values.dataresource) if (error) { -- Gitblit v1.8.0