first commit

This commit is contained in:
baozaotumao2025
2026-07-18 21:10:39 +08:00
commit 1b90e552a5
91 changed files with 9056 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import { ApiClient } from './client'
import { session } from '../auth/session'
import { createAuthRefresh } from '../auth/refresh'
const baseUrl = import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:8000/api/v1'
const normalizedBaseUrl = baseUrl.replace(/\/$/, '')
export const refreshAuth = createAuthRefresh(normalizedBaseUrl)
export const api = new ApiClient(normalizedBaseUrl, () => session.get()?.access_token || null, refreshAuth)