From b231b7704376fc345312d1df08f383c6a20d02ee Mon Sep 17 00:00:00 2001 From: fangyunong Date: Fri, 4 Jul 2025 11:33:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0request.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + auto-imports.d.ts | 1 + src/App.vue | 1 + src/api/loginApi.ts | 7 ++ src/store/app.ts | 2 +- src/utils/auth.ts | 11 ++- src/utils/index.ts | 4 ++ src/utils/request.ts | 113 ++++++++++++++++++++++++++++++ src/views/login/OauthCallBack.vue | 7 +- src/views/login/index.vue | 4 +- tsconfig.json | 10 +-- vite.config.ts | 4 ++ 12 files changed, 152 insertions(+), 13 deletions(-) create mode 100644 .env create mode 100644 src/api/loginApi.ts create mode 100644 src/utils/index.ts create mode 100644 src/utils/request.ts diff --git a/.env b/.env new file mode 100644 index 0000000..7518860 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VITE_API_BASE_URL=http://your-api-url.com \ No newline at end of file diff --git a/auto-imports.d.ts b/auto-imports.d.ts index d0c217f..319befa 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -21,6 +21,7 @@ declare global { const isReactive: typeof import('vue')['isReactive'] const isReadonly: typeof import('vue')['isReadonly'] const isRef: typeof import('vue')['isRef'] + const login: typeof import('./src/api/loginApi')['login'] const markRaw: typeof import('vue')['markRaw'] const nextTick: typeof import('vue')['nextTick'] const onActivated: typeof import('vue')['onActivated'] diff --git a/src/App.vue b/src/App.vue index 9a73251..f8d4136 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,6 +10,7 @@