Files
pda-uniapp/config/runtime.js
T

11 lines
439 B
JavaScript
Raw Normal View History

const configuredApiRoot = import.meta.env.VITE_API_BASE_URL || ''
2026-08-25 20:52:11 +08:00
let selectedApiRoot = configuredApiRoot || '/api'
2026-08-11 11:31:05 +08:00
2026-08-25 20:52:11 +08:00
// H5 必须请求同源地址,由 Vite 开发服务器代理到国内 Gateway,避免浏览器 CORS。
// #ifdef H5
selectedApiRoot = import.meta.env.VITE_H5_API_BASE_URL || '/api'
// #endif
export const API_ROOT = String(selectedApiRoot).replace(/\/$/, '')
2026-08-11 11:31:05 +08:00
export const PLATFORM_API_ROOT = `${API_ROOT}/platform/v1`