From 1e4a2c74f6782a1f1e3d745830948f3255871f61 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 30 十一月 2021 21:08:49 +0800 Subject: [PATCH] 2021-11-30 --- public/options.json | 2 src/assets/css/viewstyle.scss | 14 ++++ src/tabviews/zshare/topSearch/index.jsx | 43 +++++++++++++- src/templates/zshare/verifycard/index.jsx | 6 +- src/views/login/index.jsx | 75 ++++++++++++++++++++++++- 5 files changed, 129 insertions(+), 11 deletions(-) diff --git a/public/options.json b/public/options.json index c5f281e..6fd5cc5 100644 --- a/public/options.json +++ b/public/options.json @@ -10,7 +10,7 @@ "defaultLang": "zh-CN", "WXAppID": "", "debugger": false, - "licenseKey": "", + "licenseKey": "7EFE13KIKKILIJ7C8CFC", "probation": "", "host": "http://demo.mk9h.cn", "service": "erp_new/" diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index ac02bdb..7e3c55b 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -441,6 +441,20 @@ border-color: $color6; } } + .ant-carousel { + .slick-dots { + >li { + button { + background-color: $color3; + } + } + >li.slick-active { + button { + background-color: $color6; + } + } + } + } } body.hidden-split-line #root { // 鍘婚櫎鐧诲綍椤靛垎鍓茬嚎 diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 4a2ad50..cbb6432 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -520,9 +520,16 @@ this.props.form.validateFields((err, values) => { if (err) return - let searches = this.getFieldsValues(values) + let { searches, error } = this.getFieldsValues(values) - if (this.state.hasReqFields) { + if (error) { + notification.warning({ + top: 92, + message: error, + duration: 3 + }) + return + } else if (this.state.hasReqFields) { let requireFields = searches.filter(item => item.required && item.value === '') if (requireFields.length > 0) { let labels = requireFields.map(item => item.label) @@ -580,6 +587,7 @@ // 鑾峰彇鎼滅储鏉′欢鍊� let search = [] + let error = null searchlist.forEach(item => { if (item.type === 'group') { search.push({ @@ -601,10 +609,37 @@ }) } else { let type = item.type + let val = values[item.field] !== undefined ? values[item.field] : '' + if (type === 'multiselect' || (type === 'checkcard' && item.multiple === 'true')) { type = 'multi' + } else if (type === 'text' && !error) { + if (/'/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鑻辨枃鐘舵�佺殑鍗曞紩鍙枫�俙 + } else if (/(^|\s)select\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梥elect銆俙 + } else if (/\sfrom(\s|\()/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梖rom銆俙 + } else if (/(^|\s)insert\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梚nsert銆俙 + } else if (/(^|\s)delete\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梔elete銆俙 + } else if (/(^|\s)update\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梪pdate銆俙 + } else if (/(^|\s)where\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梬here銆俙 + } else if (/(^|\s)drop\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梔rop銆俙 + } else if (/(^|\s)exec\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梕xec銆俙 + } else if (/(^|\s)truncate\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梩runcate銆俙 + } else if (/(^|\s)while\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梬hile銆俙 + } else if (/(^|\s)for\s/ig.test(val)) { + error = `鎼滅储鏉′欢${item.label}涓紝涓嶅彲浣跨敤鍏抽敭瀛梖or銆俙 + } } - let val = values[item.field] !== undefined ? values[item.field] : '' if (typeof(val) === 'string') { val = val.replace(/(^\s*|\s*$)/ig, '') @@ -622,7 +657,7 @@ } }) - return search + return {searches: search, error} } handleOk = (values) => { diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 94e8755..ffb2438 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -228,7 +228,7 @@ render: (text) => { let title = text.match(/^\s*\/\*.+\*\//) title = title && title[0] ? title[0] : '' - text = title ? text.replace(title, '') : text + // text = title ? text.replace(title, '') : text return ( <div> @@ -298,7 +298,7 @@ render: (text) => { let title = text.match(/^\s*\/\*.+\*\//) title = title && title[0] ? title[0] : '' - text = title ? text.replace(title, '') : text + // text = title ? text.replace(title, '') : text return ( <div> @@ -367,7 +367,7 @@ render: (text) => { let title = text.match(/^\s*\/\*.+\*\//) title = title && title[0] ? title[0] : '' - text = title ? text.replace(title, '') : text + // text = title ? text.replace(title, '') : text return ( <div> diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index ee716bc..fe62be2 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -328,16 +328,85 @@ let _s = md5('mksoft' + moment().format('YYYYMMDD')) authCode = authCode ? authCode.split(',') : [] let index = authCode.findIndex(key => key === _s) + let license = false - let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6) + if (window.GLOB.licenseKey) { + if (window.GLOB.licenseKey.length !== 20) { + Modal.warning({ + title: `鏈湴鎺堟潈鐮佸凡澶辨晥锛岃鑱旂郴绠$悊鍛樸�俙, + okText: '鐭ラ亾浜�' + }) + } else { + let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6) + + let key1 = window.GLOB.licenseKey.substring(0, 6) + let key2 = window.GLOB.licenseKey.substring(6, 14) + let key3 = window.GLOB.licenseKey.substring(14) + let key4 = md5(key1 + key2).toUpperCase().substr(-6) + + if (key === key1 && key3 === key4) { + let last = window.GLOB.appkey[window.GLOB.appkey.length - 1] + let offset = 0 + let keys = {} + + if (!isNaN(+last)) { + offset = (10 - last) % 10 + } else { + last = last.charCodeAt() - 65 + offset = (30 - last) % 10 + } + + for (let i = 0; i < 26; i++) { + let char = String.fromCharCode(65 + i) + keys[char] = (offset + i) % 10 + } + + let lictime = +key2.replace(/[A-Z]/ig, (s) => { + return keys[s] + }) + let curtime = +moment().format('YYYYMMDD') + let licday = lictime - curtime + let _mindUrl = window.location.href.split('#')[0] + 'notMind' - if (index > -1 || window.GLOB.licenseKey === key) { + if (licday < 0 || isNaN(licday)) { + Modal.warning({ + title: '鏈湴鎺堟潈鐮佸凡澶辨晥锛岃鑱旂郴绠$悊鍛樸��', + okText: '鐭ラ亾浜�' + }) + } else if (licday > 20) { + license = true + localStorage.removeItem(_mindUrl) + } else { + license = true + + if (localStorage.getItem(_mindUrl) !== 'false') { + Modal.confirm({ + title: `璺濈鎺堟潈鍒版湡杩樺墿${licday}澶╋紝璇疯仈绯荤鐞嗗憳銆俙, + okText: '涓嶅湪鎻愰啋', + cancelText: '鍏抽棴', + onOk() { + localStorage.setItem(_mindUrl, 'false') + }, + onCancel() {}, + }) + } + } + } else { + Modal.warning({ + title: '鏈湴鎺堟潈鐮佸凡澶辨晥锛岃鑱旂郴绠$悊鍛樸��', + okText: '鐭ラ亾浜�' + }) + } + } + } + + if ((!window.GLOB.licenseKey && index > -1) || license) { this.setState({ auth: true }) } - if (window.GLOB.licenseKey !== key && (index === -1 || index > 5)) { + if (!window.GLOB.licenseKey && (index === -1 || index > 5)) { let _appId = window.GLOB.appId if (options.sysType === 'cloud') { // 浜戠浣跨敤绯荤粺閰嶇疆appid -- Gitblit v1.8.0