king
2022-09-16 530e033f9fdba1dfd02848d5839fd348ca6eeed1
src/api/index.js
@@ -42,11 +42,6 @@
const setCurrentUrl = (res) => {
  if (!!(window.history && window.history.pushState)) {
    if (window.location.href.indexOf('paramsmain') > -1) {
      let _href = window.location.href.split('#')
      localStorage.setItem(_href[0] + 'paramsmain', _href[1])
    }
    sessionStorage.clear()
    sessionStorage.setItem('loginError', JSON.stringify({url: res.config ? res.config.url : '', request: res.config ? res.config.data : '', response: JSON.stringify(res.data)}))
    window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
@@ -86,11 +81,7 @@
class Api {
  constructor() {
    if (process.env.NODE_ENV === 'production') {
      axios.defaults.baseURL = document.location.origin + '/' + window.GLOB.service
    } else {
      axios.defaults.baseURL = window.GLOB.location + '/' + window.GLOB.service
    }
    axios.defaults.baseURL = window.GLOB.baseurl
  }
  
  /**
@@ -111,7 +102,7 @@
   * @description 微信业务请求
   */
  wxAccessToken () {
    let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/getaccesstoken'
    let _url = window.GLOB.baseurl + 'wxpay/getaccesstoken'
    if (process.env.NODE_ENV !== 'production') {
      _url = document.location.origin + '/wxpay/getaccesstoken'
    }
@@ -666,11 +657,10 @@
  /**
   * @description 获取本地系统配置
   * @param {Object}  param   请求参数
   */
  getLocalCacheConfig (param) {
    param.userid = sessionStorage.getItem('UserID') || ''
    param.lang = param.lang || sessionStorage.getItem('lang') || ''
    param.lang = sessionStorage.getItem('lang') || ''
    param.SessionUid = localStorage.getItem('SessionUid') || ''
    param.LoginUID = sessionStorage.getItem('LoginUID') || ''
    param.appkey = window.GLOB.appkey || ''
@@ -928,7 +918,7 @@
   * @description 获取微信支付二维码
   */
  getWxNativePay (param) {
    let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/wxNativePay'
    let _url = window.GLOB.baseurl + 'wxpay/wxNativePay'
    if (process.env.NODE_ENV !== 'production') {
      _url = document.location.origin + '/wxpay/wxNativePay'
    }