小程序微信后台和代理后台使用同一个域名

This commit is contained in:
2026-04-14 00:12:00 +08:00
parent a7c2448207
commit fbd10ad1f9
112 changed files with 510 additions and 405 deletions

View File

@@ -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')