king
2020-06-05 24f0ce147c8daef39ec437d5def9d089ea5b1839
src/utils/utils.js
@@ -2,8 +2,6 @@
import md5 from 'md5'
import options from '@/store/options.js'
const service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : ''
export default class Utils {
  /**
   * @description 生成32位uuid string + 时间
@@ -67,10 +65,10 @@
      {key: 'alter', reg: /(^|\s)alter\s/ig},
      {key: 'truncate', reg: /(^|\s)truncate\s/ig},
      {key: 'if', reg: /(^|\s)if\s/ig},
      {key: 'exec', reg: /exec/ig},
      {key: 'OBJECT', reg: /object/ig},
      {key: 'sys.', reg: /sys\./ig},
      {key: 'kill', reg: /kill/ig}
      {key: 'exec', reg: /(^|\s)exec(\s|\()/ig},
      {key: 'OBJECT', reg: /(^|\s)object(\s|\()/ig},
      {key: 'sys.', reg: /(^|\s)sys\./ig},
      {key: 'kill', reg: /(^|\s)kill\s/ig}
    ]
    if (type === 'customscript') {
@@ -553,9 +551,9 @@
    let baseurl = ''
    if (process.env.NODE_ENV === 'production') {
      baseurl = document.location.origin + '/' + service
      baseurl = document.location.origin + '/' + window.GLOB.service
    } else {
      baseurl = 'http://qingqiumarket.cn/' + service
      baseurl = window.GLOB.location + window.GLOB.service
    }
    // if (!/Content\/images\/upload\//.test(url)) {
    //   baseurl = baseurl + 'Content/images/upload/'
@@ -576,7 +574,7 @@
    if (options.cloudServiceApi) {
      baseurl = options.cloudServiceApi.replace(/webapi(.*)$/, '')
    } else {
      baseurl = document.location.origin + '/' + service
      baseurl = document.location.origin + '/' + window.GLOB.service
    }
    return url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url
@@ -1141,11 +1139,11 @@
        /* 同类数据验证 */
        Set @tbid=''
        Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 an n from ${datasource} ) tb  inner join (select ID from  dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1
        Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 as n from ${datasource} ) tb  inner join (select ID from  dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1
        
        If @tbid!=''
        Begin
          Set @errorcode='E' ,Set @remsg='${item.fieldlabel} 值不唯一'
          Set @ErrorCode='E' Set @retmsg='${item.fieldlabel} 值不唯一'
          goto aaa
        end
        `