Add centralized API client with axios interceptors, remove vue-axios

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 12:44:33 +08:00
parent 6af7253d08
commit 147b16ca34
29 changed files with 301 additions and 270 deletions

View File

@@ -4,11 +4,3 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any>;
export default component;
}
declare module 'vue/types/vue' {
import { AxiosInstance } from 'axios';
interface Vue {
$axios: AxiosInstance;
}
}

View File

@@ -1,7 +1,8 @@
import { AxiosInstance } from 'axios';
import 'pinia';
import { Router } from 'vue-router';
declare module 'pinia' {
export interface PiniaCustomProperties {
$axios: AxiosInstance;
$router: Router;
}
}
}

View File

@@ -1,7 +1 @@
import { AxiosInstance } from 'axios';
declare module 'vue/types/vue' {
interface Vue {
$axios: AxiosInstance;
}
}
// vue-axios type declarations removed — API client is used directly

14
src/types/vue.d.ts vendored
View File

@@ -1,15 +1 @@
import { AxiosInstance } from 'axios';
import { App } from 'vue';
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$http: AxiosInstance;
}
}
// 將類型擴展到 Vue 應用實例
declare module 'vue' {
interface App {
$http: AxiosInstance;
}
}