king
2024-12-27 e5a92d6bee2b8d47d5c145ed92485fd19b663b0f
src/api/index.js
@@ -74,6 +74,32 @@
      placement: 'bottomRight',
      duration: 15
    })
    if ([500, 504].includes(response.status) && error.config && error.config.url && error.config.data) {
      window.mkInfo(error.config.url)
      window.mkInfo(error.config.data)
      if (window.GLOB.errorLog && !sessionStorage.getItem('local_error')) {
        let urlReg = new RegExp('^(' + window.GLOB.baseurl + '|/)webapi/(exstars|dostars)', 'ig')
        if (urlReg.test(error.config.url) && !/s_special_error_note_log/.test(error.config.url)) {
          let res = null
          try {
            let data = JSON.parse(error.config.data)
            if (!data.rduri) {
              res = {
                api_url: error.config.url,
                error_code: response.status,
                error_time: moment().format('YYYY-MM-DD HH:mm:ss'),
                api_param: error.config.data
              }
            }
          } catch (e) {
            res = null
          }
          if (res) {
            sessionStorage.setItem('local_error', JSON.stringify(res))
          }
        }
      }
    }
  }
  return Promise.reject(response)
@@ -175,12 +201,7 @@
   * @description 游客登录
   */
  getTouristMsg (binding_type, appid, openid, memberid, scanId) {
    let _SessionUid = localStorage.getItem('SessionUid')
    if (!_SessionUid) { // 手动清除SessionUid时,实时生成
      _SessionUid = Utils.getuuid()
      localStorage.setItem('SessionUid', _SessionUid)
    }
    let _SessionUid = localStorage.getItem('SessionUid') || ''
    let param = {
      func: 's_visitor_login',
@@ -1265,7 +1286,7 @@
  /**
   * @description sql检验
   */
  sDebug (sql) {
  sDebug (sql, skip = false) {
    let param = {
      func: 's_debug_sql',
      exec_type: window.GLOB.execType || 'y',
@@ -1293,6 +1314,8 @@
    window.mkInfo(`/* sql 验证 */\n${sql.replace(/\n\s{6,20}/ig, '\n')}`)
    if (skip) return
    sql = sql.replace(/\n/ig, ' ')
    param.LText = Utils.formatOptions(sql, param.exec_type)