king
2021-11-18 c98e45bfac25e9110ad0383faac54a54d98ea9d5
src/api/index.js
@@ -14,7 +14,7 @@
  1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg,
  1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467,
  1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,15900310928174dro07ihfckghpb5h13,1594095599055qicg2eb642v5qglhnuo,1599613340050c8nu6rbst9d4emnnbsq,1577972969199lei1g0qkvlh4tkc908m,
  1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv`
  1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv,15827879285193g85m3i2uprektpgmpf`
if (window.openDatabase) {
  CacheUtils.openWebSql(options.sysType)
@@ -141,7 +141,7 @@
  /**
   * @description 游客登录
   */
  getTouristMsg () {
  getTouristMsg (appid, openid, memberid, scanId) {
    let _SessionUid = localStorage.getItem('SessionUid')
    if (!_SessionUid) { // 手动清除SessionUid时,实时生成
@@ -160,6 +160,14 @@
    param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
    param.appkey = window.GLOB.appkey || ''
    if (appid) {
      param.binding_type = 'mk'
      param.thd_party_member_id = memberid
      param.thd_party_openid = openid
      param.thd_party_appid = appid
      param.id = scanId
    }
    let url = '/webapi/dologon/s_visitor_login'
    if (window.GLOB.mainSystemApi) {
@@ -280,7 +288,6 @@
   * @description 获取系统版本信息,启用或更新websql
   */
  getAppVersion (_resolve, _reject) {
    let appVersion = {}
    if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
      return Promise.reject()
    }
@@ -296,10 +303,14 @@
    if (window.GLOB.WebSql) {
      return new Promise((resolve, reject) => {
        CacheUtils.getWebSqlVersion().then(msg => {
          appVersion.oldVersion = msg.version || ''
          let modifydate = msg.createDate || curTime
          if (modifydate.indexOf('Invalid date') > -1) {
            modifydate = curTime
          }
          let param = {
            func: 's_get_app_version',
            modifydate: msg.createDate || curTime,
            modifydate
          }
  
          this.getSystemConfig(param).then(res => {
@@ -308,9 +319,7 @@
              return
            }
            let clear = false
            let version = res.app_version || '1.00'
            appVersion.newVersion = version
            appVersion.oldVersion = appVersion.oldVersion || version
            let version = '1.00'
  
            if (res.menu_data && res.menu_data.length > 0) {
              res.menu_data.forEach(mid => {
@@ -333,7 +342,7 @@
              CacheUtils.createWebSqlversion(version, curTime)
            }
  
            resolve(appVersion)
            resolve()
          })
        }, () => {
          reject()
@@ -342,10 +351,13 @@
    } else {
      return new Promise((resolve, reject) => {
        CacheUtils.getIndexDBVersion().then(msg => {
          appVersion.oldVersion = msg.version || ''
          let modifydate = msg.createDate || curTime
          if (modifydate.indexOf('Invalid date') > -1) {
            modifydate = curTime
          }
          let param = {
            func: 's_get_app_version',
            modifydate: msg.createDate || curTime,
            modifydate
          }
          this.getSystemConfig(param).then(res => {
@@ -354,9 +366,7 @@
              return
            }
            let clear = false
            let version = res.app_version || '1.00'
            appVersion.newVersion = version
            appVersion.oldVersion = appVersion.oldVersion || version
            let version = '1.00'
  
            if (res.menu_data && res.menu_data.length > 0) {
              res.menu_data.forEach(mid => {
@@ -373,9 +383,9 @@
              }
            }
            CacheUtils.updateIndexDBversion({version: appVersion.oldVersion, createDate: curTime})
            CacheUtils.updateIndexDBversion({version: version, createDate: curTime})
  
            resolve(appVersion)
            resolve()
          })
        }, () => {
          reject()
@@ -387,12 +397,13 @@
  /**
   * @description 更新系统版本信息,清空配置信息
   */
  updateAppVersion (newVersion) {
  updateAppVersion () {
    let curTime = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    CacheUtils.clearWebSqlConfig()
    CacheUtils.updateWebSqlversion(newVersion, curTime)
    CacheUtils.updateWebSqlversion('1.00', curTime)
    CacheUtils.clearIndexDBConfig()
    CacheUtils.updateIndexDBversion({version: newVersion, createDate: curTime})
    CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime})
    CacheUtils.clearFuncs(options.sysType)
  }
  /**
@@ -450,7 +461,7 @@
      appkey: window.GLOB.appkey
    }
    let url = window.GLOB.mainSystemApi
    let url = window.GLOB.mainSystemApi || '/webapi/dostars'
    param = this.encryptParam(param)
    return axios({
@@ -468,7 +479,7 @@
    param.lang = param.lang || sessionStorage.getItem('lang') || ''
    param.SessionUid = localStorage.getItem('SessionUid') || ''
    param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || ''
    param.appkey = window.GLOB.appkey || ''
    param.appkey = param.appkey || window.GLOB.appkey
    let url = '/webapi/dostars'
    if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 编辑状态,且存在云端地址
@@ -665,7 +676,7 @@
   * @param {Object}  param   请求参数
   * @param {Boolean} SSO     是否为单点登录地址
   */
  getSystemCacheConfig (param) {
  getSystemCacheConfig (param, cache = true) {
    param.userid = param.userid || sessionStorage.getItem('UserID') || ''
    param.lang = param.lang || sessionStorage.getItem('lang') || ''
    param.SessionUid = localStorage.getItem('SessionUid') || ''
@@ -685,7 +696,7 @@
    _param = JSON.stringify(_param)
    _param  = md5(_param)
    if (window.GLOB.CacheMap.has(_param)) {
    if (cache && window.GLOB.CacheMap.has(_param)) {
      return Promise.resolve(window.GLOB.CacheMap.get(_param))
    } else {
      param = this.encryptParam(param)
@@ -775,7 +786,7 @@
            }
            resolve()
          }
        } catch {
        } catch (e) {
          resolve({
            ErrCode: 'E',
            ErrMesg: '文件解析错误',