king
2023-12-14 0eb129a9beddbb86ae74d7106a8e60823206b8d5
src/api/index.js
@@ -420,7 +420,7 @@
  }
  /**
   * @description 获取系统版本信息,启用或更新websql
   * @description 获取系统版本信息
   */
  getAppVersion (reload) {
    if (!window.GLOB.IndexDB) {
@@ -918,9 +918,6 @@
      param.fullname = sessionStorage.getItem('Full_Name') || ''
    }
    let login = false
    let rduri = null
    if (param.rduri && /\s|\n/.test(param.rduri)) {
      param.rduri = param.rduri.replace(/\s|\n/g, '')
      if (!param.rduri) {
@@ -928,31 +925,32 @@
      }
    }
    if (param.$login && !window.GLOB.transfer) {
      login = true
      rduri = param.rduri || ''
    }
    delete param.$login
    if (param.$login) {
      let rduri = param.rduri || ''
    let url = '/webapi/dostars'
    if (param.rduri && !window.GLOB.transfer && /\/dostars/.test(param.rduri) && param.func !== 'webapi_ChangeUser') {
      url = param.rduri
      delete param.$login
      delete param.rduri
    }
    param = this.encryptParam(param)
      param = this.encryptParam(param)
    if (login) {
      let time = +sessionStorage.getItem(rduri)
      let c_time = Math.round(new Date().getTime() / 1000)
      if (time && c_time - time <= 1800) {
        sessionStorage.setItem(rduri, c_time)
        return axios({
          url: `${url}${param.func ? '/' + param.func : ''}`,
          method: 'post',
          data: JSON.stringify(param)
        return new Promise((resolve, reject) => {
          axios({
            url: `${rduri}${param.func ? '/' + param.func : ''}`,
            method: 'post',
            data: JSON.stringify(param)
          }).then(result => {
            if (result && result.ErrCode === 'LoginError') {
              sessionStorage.removeItem(rduri)
            }
            resolve(result)
          }, () => {
            reject()
          })
        })
      }
@@ -961,11 +959,13 @@
          if (res.status) {
            sessionStorage.setItem(rduri, c_time)
            axios({
              url: `${url}${param.func ? '/' + param.func : ''}`,
              url: `${rduri}${param.func ? '/' + param.func : ''}`,
              method: 'post',
              data: JSON.stringify(param)
            }).then(result => {
              resolve(result)
            }, () => {
              reject()
            })
          } else {
            resolve(res)
@@ -984,6 +984,14 @@
        })
      })
    } else {
      let url = '/webapi/dostars'
      if (param.rduri && !window.GLOB.transfer && /\/dostars/.test(param.rduri) && param.func !== 'webapi_ChangeUser') {
        url = param.rduri
        delete param.rduri
      }
      param = this.encryptParam(param)
      return axios({
        url: `${url}${param.func ? '/' + param.func : ''}`,
        method: 'post',