This commit is contained in:
2026-05-17 21:23:25 +08:00
parent 6a5d729568
commit 8d784c2939
9 changed files with 746 additions and 23 deletions

View File

@ -8,7 +8,7 @@ export type HttpClient = {
};
export const httpClient: HttpClient = {
baseURL: 'http://localhost:3000',
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000',
headers: {
'Content-Type': 'application/json'
},

12
src/config.js Normal file
View File

@ -0,0 +1,12 @@
// SDK 配置
const config = {
// API 基础地址
apiBaseUrl: import.meta.env.VITE_API_BASE_URL || 'http://localhost:26517',
// 获取完整的 API 地址
getApiUrl(path) {
return `${this.apiBaseUrl}${path}`
}
}
export default config