feat: add SingleRecordMnt component for student record maintenance with search, add, edit, view, and delete functionalities

This commit is contained in:
skytek_xinliang
2026-03-26 11:24:37 +08:00
parent 507afcc99c
commit 069141794e
116 changed files with 15247 additions and 107 deletions
+22
View File
@@ -0,0 +1,22 @@
import axios, { type AxiosInstance } from 'axios'
import { setupInterceptors } from './interceptors'
// HTTP ClientAxios instance
//
// 設計重點:
// - 透過單一 axios instance 統一管理 baseURL、timeout、headers 與攔截器
// - 預設 baseURL 使用 `/api`:搭配 Vite proxy 轉送到後端 dev server
// - 攔截器集中在 `interceptors.ts`,避免 client.ts 變得難維護
function createClient (): AxiosInstance {
const baseURL = import.meta.env.VITE_API_BASE_URL || '/service/api'
const client = axios.create({
baseURL,
timeout: 10_000,
withCredentials: true,
})
setupInterceptors(client)
return client
}
export const httpClient = createClient()