统一后台接口

This commit is contained in:
ZLI263
2025-11-23 20:05:50 +08:00
parent 78d8db3c68
commit 1ccfa25781

15
common/config.js Normal file
View File

@@ -0,0 +1,15 @@
/**
* API 配置
* 统一管理后端接口地址
*/
// API 基础地址
export const API_BASE_URL = 'https://api.huayang-star.com/'
// 导出完整的 API URL 构建函数
export function getApiUrl(path) {
// 确保 path 以 / 开头
const apiPath = path.startsWith('/') ? path : `/${path}`
return `${API_BASE_URL}${apiPath.replace(/^\//, '')}`
}