king
2023-09-18 11b6387d74467f81e33eba8f882bff610f240115
src/templates/zshare/verifycard/customform/index.jsx
@@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Button, notification, Modal, Tooltip } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -110,12 +109,7 @@
          return
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
        }
        param.LText = `${this.props.initsql}
        let sql = `${this.props.initsql}
          /* 自定义验证 */
          select @tbid='', @ErrorCode='',@retmsg=''
          select top 1 @tbid='X' from (${values.sql}) a
@@ -129,30 +123,17 @@
        if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
          window.GLOB.funcs.forEach(item => {
            let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
            param.LText = param.LText.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
            sql = sql.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
          })
        }
        
        // 数据权限
        param.LText = param.LText.replace(/@\$|\$@/ig, '')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{10}/ig, '\n')}`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        sql = sql.replace(/@\$|\$@/ig, '')
        sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        this.setState({loading: true})
        Api.genericInterface(param).then(res => {
          if (res.status) {
        Api.sDebug(sql).then(res => {
          if (res.status || res.ErrCode === '-2') {
            this.setState({
              loading: false,
              editItem: null