host.js 1.44 KB
// php测试环境
// export const php = 'http://test.pet-dbc.cn/mobile/index.php?'

// php镜像
// export const php = 'https://jingxiang.pet-dbc.cn/mobile/index.php?'

// php正式环境
// export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'

// go测试环境
// export const go = 'https://tm.pet-dbc.cn'

// go镜像环境 
// export const go = 'https://jxm.pet-dbc.cn'

// go正式环境
// export const go = 'https://m.pet-dbc.cn';

// 获取php正式环境
export const php = phpfunc();
// 获取跳转白条地址
export const go = gofunc();

/**
 * 根据当前域名返回ecmall地址
 * */ 
function phpfunc(){
	const { origin } = window.location;
	let url = '';
	// 测试环境
	if(origin.indexOf('local') > -1 || origin.indexOf('test') > -1){
		if(origin.indexOf('test') > -1){
			url = `${origin}/mobile/index.php?`;
		}else{
			url = 'https://test.pet-dbc.cn/mobile/index.php?';
		}
	}else if(origin.indexOf('jingxiang') > -1){
		url = 'https://jingxiang.pet-dbc.cn/mobile/index.php?';
	}else{
		url = 'https://shop.pet-dbc.cn/mobile/index.php?';
	}
	return url;
}

/**
 * 根据当前域名返回白条地址
 * */ 
 
function gofunc(){
	const { origin } = window.location;
	let url = '';
	// 测试环境
	if(origin.indexOf('localhost') > -1 || origin.indexOf('test') > -1){
		url = 'https://tm.pet-dbc.cn';
	}else if(origin.indexOf('jingxiang') > -1){
		url = 'https://jxm.pet-dbc.cn';
	}else{
		url = 'https://m.pet-dbc.cn';
	}
	return url;
}