优化
This commit is contained in:
+7
-1
@@ -1,4 +1,10 @@
|
||||
const configuredApiRoot = import.meta.env.VITE_API_BASE_URL || ''
|
||||
let selectedApiRoot = configuredApiRoot || '/api'
|
||||
|
||||
export const API_ROOT = String(configuredApiRoot || '/api').replace(/\/$/, '')
|
||||
// H5 必须请求同源地址,由 Vite 开发服务器代理到国内 Gateway,避免浏览器 CORS。
|
||||
// #ifdef H5
|
||||
selectedApiRoot = import.meta.env.VITE_H5_API_BASE_URL || '/api'
|
||||
// #endif
|
||||
|
||||
export const API_ROOT = String(selectedApiRoot).replace(/\/$/, '')
|
||||
export const PLATFORM_API_ROOT = `${API_ROOT}/platform/v1`
|
||||
|
||||
Reference in New Issue
Block a user