This commit is contained in:
2026-09-29 17:56:05 +08:00
parent ef5c8250c5
commit 0aaf855ce2
13 changed files with 121 additions and 145 deletions
+3 -3
View File
@@ -45,12 +45,12 @@ function overseasUrl(path) {
const nativeRuntime = typeof plus !== 'undefined'
|| (typeof location !== 'undefined' && location.protocol === 'file:')
if (nativeRuntime && !/^https?:\/\//i.test(base)) {
const error = new Error('海外服务地址未配置:App 必须设置绝对 HTTP(S) 地址 VITE_OVERSEAS_API_BASE_URL')
error.code = 'PDA_OVERSEAS_API_BASE_REQUIRED'
const error = new Error('海外服务地址未配置:App 必须设置绝对 HTTP(S) 地址 VITE_API_BASE_URL')
error.code = 'PDA_API_BASE_REQUIRED'
throw error
}
const value = `/${String(path || '').replace(/^\/+/, '')}`
const normalized = /\/(?:api|overseas-api)$/.test(base)
const normalized = /\/api$/.test(base)
? value.replace(/^\/api(?=\/)/, '')
: value
return `${base}${normalized}`