提供独立路径的海外PDA测试H5部署

This commit is contained in:
2026-09-29 20:57:40 +08:00
parent b118189e4e
commit 4a36da292e
10 changed files with 182 additions and 10 deletions
+8 -10
View File
@@ -1,15 +1,13 @@
const runtimeEnvironment = import.meta.env || {}
const configuredApiRoot = runtimeEnvironment.VITE_API_BASE_URL || ''
const development = Boolean(runtimeEnvironment.DEV)
let selectedApiRoot = configuredApiRoot || '/api'
const development = Boolean(import.meta.env?.DEV)
let selectedApiRoot = ''
// #ifndef H5
selectedApiRoot = import.meta.env?.VITE_API_BASE_URL || ''
// #endif
// #ifdef H5
selectedApiRoot = runtimeEnvironment.VITE_H5_API_BASE_URL || '/api'
selectedApiRoot = import.meta.env?.VITE_H5_API_BASE_URL || '/api'
// #endif
const nativeRuntime = typeof plus !== 'undefined'
|| (typeof location !== 'undefined' && location.protocol === 'file:')
if (nativeRuntime) selectedApiRoot = configuredApiRoot || ''
export const API_ROOT = String(selectedApiRoot).replace(/\/$/, '')
export const DEV_LOGIN = Object.freeze({
username: development ? String(runtimeEnvironment.VITE_PDA_DEV_USERNAME || '') : '',
password: development ? String(runtimeEnvironment.VITE_PDA_DEV_PASSWORD || '') : ''
username: development ? String(import.meta.env?.VITE_PDA_DEV_USERNAME || '') : '',
password: development ? String(import.meta.env?.VITE_PDA_DEV_PASSWORD || '') : ''
})
+3
View File
@@ -80,6 +80,9 @@
},
"vueVersion" : "3",
"h5" : {
"router" : {
"mode" : "hash"
},
"devServer" : {
"port" : 5176
}