index.js 680 Bytes
/*
 * @Descripttion:
 * @version:
 * @Author: limin
 * @Date: 2021-06-07 14:12:32
 * @LastEditors: limin
 * @LastEditTime: 2021-10-06 09:27:23
 */
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = (isEnv = true) => {
  if (isEnv) {
    let { request } = cfg
    Object.assign(request, { timeout })
    return Promise.resolve(cfg)
  }
  return new Http().get('https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base/config')
}
export const config = {
  install(vue, cfg) {
    vue.prototype.$config = cfg
  }
}
export default cfg