king
2025-04-03 f81779b1391c19b603d74e47c3604ea1749ba029
src/api/index.js
@@ -48,10 +48,24 @@
        okText: '知道了',
        onOk: () => {
          window.GLOB.$error = false
          sessionStorage.clear()
          if (!!(window.history && window.history.pushState)) {
            window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
            window.location.reload()
          localStorage.removeItem('UserID')
          localStorage.removeItem('LoginUID')
          localStorage.removeItem('User_Name')
          localStorage.removeItem('Full_Name')
          localStorage.removeItem('avatar')
          localStorage.removeItem('dataM')
          localStorage.removeItem('localDataM')
          localStorage.removeItem('debug')
          localStorage.removeItem('role_id')
          localStorage.removeItem('mk_user_type')
          if (!/#\/login/.test(window.location.href)) {
            sessionStorage.clear()
            if (!!(window.history && window.history.pushState)) {
              window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
              window.location.reload()
            }
          }
        }
      })
@@ -125,6 +139,25 @@
  }
  /**
   * @description 使用dostar接口,跳过验证
   * @param {Object} param 查询及提交参数
   */
  loginAndRedirect (param) {
    let url = ''
    if (process.env.NODE_ENV === 'production') {
      url = document.location.origin + '/zh-CN/Home/LoginAndRedirect'
    } else {
      url = window.GLOB.location + '/zh-CN/Home/LoginAndRedirect'
    }
    return axios({
      url: url,
      method: 'post',
      data: qs.stringify(param)
    })
  }
  /* @description 直接请求
   * @description 微信业务请求 原接口 'wxpay/getaccesstoken'
   */
  // wxAccessToken (appId, domain = '') {