mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix(deploy): vite config lazy load
This commit is contained in:
@@ -6,8 +6,11 @@ import router from '@/router'
|
||||
* Call this once at app startup (main.ts).
|
||||
*/
|
||||
export function setupApiClient() {
|
||||
// Set base URL to match the Vite proxy
|
||||
client.setConfig({ baseUrl: '/api' })
|
||||
const apiBaseUrl = import.meta.env.VITE_API_URL?.trim() || '/api'
|
||||
const agentBaseUrl = import.meta.env.VITE_AGENT_URL?.trim() || '/agent'
|
||||
void agentBaseUrl
|
||||
|
||||
client.setConfig({ baseUrl: apiBaseUrl })
|
||||
|
||||
// Add auth token to every request
|
||||
client.interceptors.request.use((request) => {
|
||||
|
||||
Reference in New Issue
Block a user