king
2022-09-19 1393cba2082598f1c10cbc93b246b0444aa03d26
2022-09-19
2个文件已修改
20 ■■■■ 已修改文件
src/api/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -811,9 +811,22 @@
    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 <= 60) {
        sessionStorage.setItem(rduri, c_time)
        return axios({
          url: `${url}${param.func ? '/' + param.func : ''}`,
          method: 'post',
          data: param
        })
      }
      return new Promise((resolve, reject) => {
        this.getTouristMsg('login_check', rduri).then(res => {
          if (res.status) {
            sessionStorage.setItem(rduri, c_time)
            axios({
              url: `${url}${param.func ? '/' + param.func : ''}`,
              method: 'post',
src/index.js
@@ -204,14 +204,11 @@
    }
    if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限
      let _service = window.location.href.replace(/(\/admin)?\/index.html(.*)|(\/admin)?\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '')
      GLOB.linkurl = _href
      if (!/index.html/ig.test(GLOB.linkurl)) {
        GLOB.linkurl = GLOB.linkurl + 'index.html'
      }
      let _service = window.location.href.replace(/\/admin(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '')
      GLOB.service = _service ? _service + '/' : ''
      GLOB.host = window.location.host + (_service ? '_' + _service : '')
      GLOB.baseurl = document.location.origin + '/' + GLOB.service
      GLOB.linkurl = GLOB.baseurl + 'index.html'
    } else {
      GLOB.linkurl = ''
      GLOB.location = config.host