微信小程序发布试用版本

This commit is contained in:
zhonghua1
2026-01-31 21:10:40 +08:00
parent 4ebeec45bc
commit 80d6d46182
338 changed files with 5767 additions and 6091 deletions

View File

@@ -27,7 +27,9 @@ function resolveApiEnv() {
if (fileEnv) {
const mapped = ENV_ALIAS[fileEnv.toLowerCase()]
if (mapped) {
// #ifdef APP-PLUS || H5 || MP-ALIPAY
console.log('[API Config] 使用 env.js 配置:', fileEnv, '=>', mapped)
// #endif
return mapped
}
}
@@ -39,7 +41,9 @@ function resolveApiEnv() {
: ''
const aliasKey = runtimeEnv ? runtimeEnv.toLowerCase() : ''
const env = ENV_ALIAS[aliasKey] || 'prod'
// #ifdef APP-PLUS || H5 || MP-ALIPAY
console.log('[API Config] 使用环境变量:', runtimeEnv, '=>', env)
// #endif
return env
}
@@ -49,8 +53,10 @@ const API_ENV = resolveApiEnv()
export const API_BASE_URL = normalizeBaseUrl(API_TARGETS[API_ENV] || API_TARGETS.prod)
// 输出当前配置信息(便于调试)
// #ifdef APP-PLUS || H5 || MP-ALIPAY
console.log('[API Config] 当前环境:', API_ENV)
console.log('[API Config] API_BASE_URL:', API_BASE_URL)
// #endif
// 当前 API 环境local / prod
export function getApiEnv() {
@@ -66,14 +72,18 @@ export function getApiUrl(path = '') {
// H5环境下local / prod 都返回完整URL确保 prod 时直接请求远程服务器
const fullPath = apiPath.startsWith('/') ? apiPath.slice(1) : apiPath
const fullUrl = `${API_BASE_URL}${fullPath}`
// #ifdef APP-PLUS || H5 || MP-ALIPAY
console.log(`[API Config] H5环境(${API_ENV})直接使用完整URL:`, fullUrl)
// #endif
return fullUrl
// #endif
// #ifndef H5
// 其他环境使用完整URL
const fullPath = apiPath.startsWith('/') ? apiPath.slice(1) : apiPath
const fullUrl = `${API_BASE_URL}${fullPath}`
// #ifdef APP-PLUS || H5 || MP-ALIPAY
console.log('[API Config] 非H5环境使用完整URL:', fullUrl)
// #endif
return fullUrl
// #endif
}