Refactor MasterDetailMntC.vue for improved readability and consistency
This commit is contained in:
@@ -7,7 +7,7 @@ import { setupInterceptors } from './interceptors'
|
||||
// - 透過單一 axios instance 統一管理 baseURL、timeout、headers 與攔截器
|
||||
// - 預設 baseURL 使用 `/api`:搭配 Vite proxy 轉送到後端 dev server
|
||||
// - 攔截器集中在 `interceptors.ts`,避免 client.ts 變得難維護
|
||||
function createClient (): AxiosInstance {
|
||||
function createClient(): AxiosInstance {
|
||||
const baseURL = import.meta.env.VITE_API_BASE_URL || '/service/api'
|
||||
const client = axios.create({
|
||||
baseURL,
|
||||
@@ -19,4 +19,3 @@ function createClient (): AxiosInstance {
|
||||
}
|
||||
|
||||
export const httpClient = createClient()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user