优化
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ function overseasUrl(path) {
|
||||
throw error
|
||||
}
|
||||
const value = `/${String(path || '').replace(/^\/+/, '')}`
|
||||
const normalized = /\/api$/.test(base)
|
||||
const normalized = /\/(?:api|gateway-api)$/.test(base)
|
||||
? value.replace(/^\/api(?=\/)/, '')
|
||||
: value
|
||||
return `${base}${normalized}`
|
||||
|
||||
@@ -4,7 +4,7 @@ let selectedApiRoot = ''
|
||||
selectedApiRoot = import.meta.env?.VITE_API_BASE_URL || ''
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
selectedApiRoot = import.meta.env?.VITE_H5_API_BASE_URL || '/api'
|
||||
selectedApiRoot = import.meta.env?.VITE_H5_API_BASE_URL || '/gateway-api'
|
||||
// #endif
|
||||
export const API_ROOT = String(selectedApiRoot).replace(/\/$/, '')
|
||||
export const DEV_LOGIN = Object.freeze({
|
||||
|
||||
Reference in New Issue
Block a user