提供独立路径的海外PDA测试H5部署
This commit is contained in:
+8
-10
@@ -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 || '') : ''
|
||||
})
|
||||
|
||||
@@ -80,6 +80,9 @@
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"mode" : "hash"
|
||||
},
|
||||
"devServer" : {
|
||||
"port" : 5176
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user