index.js 739 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)
  // }
  let url = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsk-ww-message-config'
  return window.fetch(url, {}).then(res => res.json())
}
export const cfg = {
  install (vue, config) {
    vue.prototype.$config = config
  }
}