From 416b7c8bc2d9095b17e7a3c5fc239e1a5f107a30 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 01 二月 2024 11:51:15 +0800 Subject: [PATCH] 大接口加密 --- src/utils/utils.js | 95 ++++++++++++++++++----------------------------- 1 files changed, 37 insertions(+), 58 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index f4dc5e3..61b28c5 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -171,59 +171,6 @@ // } /** - * @description sPC_TableData_InUpDe sql鍔犲瘑 - * @return {String} value - */ - static sPCInUpDeFormatOptions (value) { - if (!value) return {LText: '', LText1: '', LText2: ''} - let salt = 'minKe' // 鐩愬�� - - value = value.replace(/\n/ig, ' \n ') - // 鏇挎崲鍏抽敭瀛� - formatKeys.forEach(item => { - let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') - value = value.replace(reg, item.value) - }) - - // 1銆佹浛鎹�%绗︼紙鏁版嵁搴撲腑瑙f瀽鍚巗ql鎶ラ敊锛� - value = value.replace(/%/ig, ' mpercent ') - // 澶栬仈鏁版嵁搴撴浛鎹� - if (window.GLOB.externalDatabase !== null) { - value = value.replace(/@db@/ig, window.GLOB.externalDatabase) - } - - let encodesql = (val) => { - if (!val) return '' - - let _value = window.btoa(window.encodeURIComponent(val)) - - // 鎻掑叆瀛楃 - let index = Math.floor(_value.length / 2) - _value = _value.slice(0, index) + salt + _value.slice(index) - - // base64鍔犲瘑 - return window.btoa(_value) - } - - let len = value.length - // 娉細LText 涓� LText1 椤哄簭棰犲�� - if (len > 1000) { - let limit = Math.floor(len / 3) - return { - LText1: encodesql(value.substring(0, limit)), - LText: encodesql(value.substring(limit, limit * 2)), - LText2: encodesql(value.substring(limit * 2)) - } - } else { - return { - LText1: '', - LText: encodesql(value), - LText2: '' - } - } - } - - /** * @description 鍒濆鍖栨悳绱㈡潯浠跺垵濮嬪�� * @param {Array} searches 鎼滅储鏉′欢 */ @@ -264,7 +211,38 @@ item.initval = item.initval ? moment().subtract(item.initval, 'days').format(format) : '' } else if (item.type === 'datemonth') { item.format = 'YYYY-MM' - item.initval = item.initval ? moment().subtract(item.initval, 'month').format('YYYY-MM') : '' + + if (item.initval) { + if (!item.dateShift) { + item.initval = moment().subtract(item.initval, 'month').format('YYYY-MM') + } else { + item.$initval = item.initval + item.$supId = config.$pageId + if (config.setting && config.setting.supModule) { + item.$supId = config.setting.supModule + + config.checkBid = true + config.setting.checkBid = true + item.checkShift = true + } + + item.initval = '' + + let d = '' + if (window.GLOB.CacheData.has(item.$supId)) { + d = window.GLOB.CacheData.get(item.$supId) + d = d[item.dateShift] || '' + if (d) { + d = moment(d).format('YYYY-MM-DD') + d = d === 'Invalid date' ? '' : d + } + } + + if (d) { + item.initval = moment(d).subtract(item.initval, 'month').format('YYYY-MM') + } + } + } } else if (item.type === 'dateweek') { item.format = 'YYYY-MM-DD' item.initval = item.initval ? moment().subtract(item.initval * 7, 'days').format('YYYY-MM-DD') : '' @@ -304,11 +282,12 @@ item.$supId = config.$pageId if (config.setting && config.setting.supModule) { item.$supId = config.setting.supModule + + config.checkBid = true + config.setting.checkBid = true + item.checkShift = true } - config.checkBid = true - config.setting.checkBid = true - item.checkShift = true item.initval = '' let d = '' @@ -2342,7 +2321,7 @@ z_debug_end: select @ErrorCode='E',@retmsg='debug_end' goto aaa` } - if (retmsg) { + if (retmsg || btn.returnValue === 'true') { _sql += ` aaa: if @ErrorCode!='' insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@` -- Gitblit v1.8.0