king
2022-09-01 a49f4888e0bc09f4e03b1d5e12be19eb2ae8636b
2022-09-01
7个文件已修改
80 ■■■■ 已修改文件
src/menu/components/form/formaction/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/formconfig.jsx
@@ -317,7 +317,7 @@
      key: 'syncComponent',
      label: '同步刷新',
      initVal: card.syncComponent,
      tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效。',
      tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。',
      required: false,
      options: modules
    },
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -693,7 +693,7 @@
      key: 'syncComponent',
      label: '刷新组件',
      initVal: card.syncComponent || [],
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效。',
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。',
      required: false,
      options: modules
    },
src/menu/datasource/verifycard/index.jsx
@@ -588,14 +588,12 @@
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp)
      if (r.error) {
      if (r.errors) {
        notification.warning({
          top: 92,
          message: r.error,
          message: r.errors,
          duration: 5
        })
        reject()
        return
      }
      let param = {
src/menu/datasource/verifycard/utils.jsx
@@ -40,8 +40,8 @@
    //   error = '系统函数' + _customScript.match(/\$ex@.{1,50}@ex\$/g)[0].replace(/\$ex@|@ex\$/g, '') + '未定义'
    // }
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
@@ -170,7 +170,7 @@
          ${_sql}
          aaa:
          if @ErrorCode!=''
            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
        `
      } else {
        sumSql = `/* sql sum验证 */
@@ -198,7 +198,7 @@
        ${_dataresource}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
      `
    } else {
      sql = `/* sql 验证 */
@@ -209,12 +209,30 @@
    console.info(sql)
    let errors = []
    if (/@[0-9a-zA-Z_]+@/ig.test(sql)) {
      let arr = sql.match(/@[0-9a-zA-Z_]+@/ig)
      arr.forEach(item => {
        let reg = new RegExp(item, 'ig')
        if (reg.test(_dataresource)) {
          errors.push(`数据源中存在未替换值${item}`)
        }
        scripts && scripts.forEach(script => {
          if (reg.test(script.sql)) {
            errors.push(`自定义脚本(${script.$index})存在未替换值${item}`)
          }
        })
      })
    }
    if (sumSql) {
      sumSql = sumSql.replace(/\n\s{10}/ig, '\n')
      console.info(sumSql)
    }
    
    return { error, sql, sumSql }
    return { error, sql, sumSql, errors: errors.join(';') }
  }
}
src/router/index.js
@@ -54,10 +54,11 @@
export default class RouteConfig extends Component {
  controlRoute (item, props) {
    if (!item.auth) {            // 不需要授权,直接跳转
    if (!item.auth) { // 不需要授权,直接跳转
      return (<item.component {...props}/>)
    }
    
    let userId = sessionStorage.getItem('UserID') // 判断登录信息是否存在,注用户可能保存主页链接
    let authCode = localStorage.getItem(window.location.href.split('#')[0] + 'AuthCode') // 判断系统是否在授权期限内
    let _s = md5('mksoft' + moment().format('YYYYMMDD'))
    let isauth = authCode && authCode.includes(_s)
@@ -68,7 +69,7 @@
      isauth = true
    }
    if (isauth) {
    if (userId && isauth) {
      return (<item.component {...props}/>)
    } else {
      return (<Redirect to={{ pathname: '/login'}}/>)
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -334,6 +334,14 @@
      param.timestamp = timestamp
      param.secretkey = Utils.encrypt('', timestamp)
      if (r.errors) {
        notification.warning({
          top: 92,
          message: r.errors,
          duration: 5
        })
      }
      let sumParam = null
      if (r.sumSql) {
        sumParam = {
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx
@@ -35,8 +35,8 @@
      })
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
@@ -110,7 +110,7 @@
          ${_sql}
          aaa:
          if @ErrorCode!=''
            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
        `
      } else {
        sumSql = `/* sql sum验证 */
@@ -134,22 +134,41 @@
        ${_dataresource}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
      `
    } else {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    let errors = []
    if (/@[0-9a-zA-Z_]+@/ig.test(sql)) {
      let arr = sql.match(/@[0-9a-zA-Z_]+@/ig)
      arr.forEach(item => {
        let reg = new RegExp(item, 'ig')
        if (reg.test(_dataresource)) {
          errors.push(`数据源中存在未替换值${item}`)
        }
        scripts && scripts.forEach(script => {
          if (reg.test(script.sql)) {
            errors.push(`自定义脚本(${script.$index})存在未替换值${item}`)
          }
        })
      })
    }
    if (sumSql) {
      sumSql = sumSql.replace(/\n\s{10}/ig, '\n')
      console.info(sumSql)
    }
    return { sql, sumSql }
    return { sql, sumSql, errors: errors.join(';') }
  }
  /**