1
This commit is contained in:
@ -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
12
src/config.js
Normal 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
|
||||
Reference in New Issue
Block a user