小程序微信后台和代理后台使用同一个域名
This commit is contained in:
@@ -21,16 +21,15 @@
|
||||
// 初始化函数
|
||||
var init = function () {
|
||||
|
||||
// 通过域名判断环境
|
||||
// 通过 env-config.js 获取 API 地址,无需硬编码域名
|
||||
var _env = window.__ENV__ || {};
|
||||
var _dlapiBase = _env.DLWEB_API_BASE_URL || '';
|
||||
switch (window.location.hostname) {
|
||||
case 'localhost':
|
||||
defaults.api_url = 'http://localhost/proxy/trunk/api/Index.php';
|
||||
break;
|
||||
case 'proxytest.tscce.cn':
|
||||
defaults.api_url = 'https://proxytest.tscce.cn/api/Index.php';
|
||||
break;
|
||||
default:
|
||||
defaults.api_url = 'https://dlapiv3.tscce.cn/Index.php';
|
||||
defaults.api_url = _dlapiBase + '/Index.php';
|
||||
}
|
||||
|
||||
if($.getPageName() === 'welcome.html')
|
||||
|
||||
Reference in New Issue
Block a user