index.js 845 Bytes
/*
 * @Descripttion:
 * @version:
 * @Author: limin
 * @Date: 2021-06-07 14:12:32
 * @LastEditors: limin
 * @LastEditTime: 2021-06-30 11:23:25
 */
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
  // if (isEnv) {
  //   let { request } = config
  //   Object.assign(request, { timeout })
  //   return Promise.resolve(config)
  // }
  /**测试mock */ return window.fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-data-view', {}).then(res => res.json())
  // return window.fetch('https://oss-config.test.glsx.com.cn/mock/62cbf569f5137cf37678b828/data-view/config', {}).then(res => res.json())
}
export const cfg = {
  install(vue, config) {
    vue.prototype.$config = config
  }
}