/**
 *
 * 全局静态变量
 * 通过this.$cons.xx调用
 *
 * created by uu
 */
// 环境修改
const ENV = 'dev'
const BASE_URL = '/wf-api'
let server_url = window.location.host
if(process.env.NODE_ENV === 'development'){
    server_url = 'tq.5000v.com:8035'
}

// 后端多环境配置
const hostConfig = {
	dev: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
	test: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
	prod: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
}

/**
 * 前端页面配置(公众号重定向需要)
 */
const frontIndexConfig = {
	dev: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
	test: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
	prod: "https://efamily.baowugroup.com/jt/bwedse/jtgc",
}
const cons = {
	ENV,
	BASE_URL,
	/**
	 * 获取当前环境配置
	 * @param {Object} env {dev、test、prod}
	 */
	host(env = ENV) {
		return `${hostConfig[env]}${BASE_URL}`
	},

	/**
	 * 获取当前环境配置
	 * @param {Object} env {dev、test、prod}
	 */
	frontIndex(env = ENV) {
		return frontIndexConfig[env]
	}

}
export default cons
