king
2021-03-30 ecbe0dc46ce2b8f607b9afd063104adeb7f10fe8
src/menu/datasource/verifycard/utils.jsx
@@ -23,21 +23,32 @@
    }
    if (setting.interType === 'system' && setting.execute !== 'false') {
      _dataresource = setting.dataresource
      _dataresource = setting.dataresource || ''
    }
    
    if (_dataresource) {
      _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    }
    if (_customScript) {
      _customScript = _customScript.replace(/@\$|\$@/ig, '')
    }
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    if (_customScript) {
      _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg =''
        ${_customScript}
      `
    }
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    if (window.GLOB.urlFields) {
      window.GLOB.urlFields.forEach(field => {
        let reg = new RegExp('@' + field + '@', 'ig')
        _dataresource = _dataresource.replace(reg, '0')
        _customScript = _customScript.replace(reg, '0')
      })
    }
    
    // 正则替换
    let _regoptions = []