From 3dfab449f793276f0bf8372df2531ec5a3a1eb22 Mon Sep 17 00:00:00 2001 From: Slowlyo <1821725017@qq.com> Date: Fri, 1 Sep 2023 23:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=A1=86=E6=9E=B6=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-views/.env | 8 + admin-views/index.html | 1 + admin-views/package.json | 71 ++--- admin-views/pnpm-lock.yaml | 249 +++++++++++++++++- admin-views/src/hooks/useApp.ts | 50 ++++ admin-views/src/hooks/useAuth.ts | 27 ++ admin-views/src/hooks/useSettings.ts | 14 + admin-views/src/hooks/useStorage.ts | 27 ++ .../src/layouts/DefaultLayout/index.tsx | 2 +- admin-views/src/layouts/index.tsx | 3 - admin-views/src/main.tsx | 26 +- admin-views/src/pages/login/index.tsx | 5 + admin-views/src/service/api/auth.ts | 27 ++ admin-views/src/service/api/base.ts | 26 ++ admin-views/src/service/api/index.ts | 2 + admin-views/src/service/index.ts | 1 + admin-views/src/service/request/config.ts | 15 ++ admin-views/src/service/request/index.ts | 5 + admin-views/src/service/request/instance.ts | 76 ++++++ admin-views/src/store/index.ts | 75 ++++++ admin-views/src/utils/common.ts | 9 + admin-views/src/utils/dynamicAssets.ts | 35 +++ admin-views/src/utils/proxy.ts | 18 ++ admin-views/src/vite-env.d.ts | 12 + admin-views/tsconfig.json | 62 +++-- admin-views/vite.config.ts | 32 ++- 26 files changed, 808 insertions(+), 70 deletions(-) create mode 100644 admin-views/.env create mode 100644 admin-views/src/hooks/useApp.ts create mode 100644 admin-views/src/hooks/useAuth.ts create mode 100644 admin-views/src/hooks/useSettings.ts create mode 100644 admin-views/src/hooks/useStorage.ts create mode 100644 admin-views/src/pages/login/index.tsx create mode 100644 admin-views/src/service/api/auth.ts create mode 100644 admin-views/src/service/api/base.ts create mode 100644 admin-views/src/service/api/index.ts create mode 100644 admin-views/src/service/index.ts create mode 100644 admin-views/src/service/request/config.ts create mode 100644 admin-views/src/service/request/index.ts create mode 100644 admin-views/src/service/request/instance.ts create mode 100644 admin-views/src/store/index.ts create mode 100644 admin-views/src/utils/dynamicAssets.ts create mode 100644 admin-views/src/utils/proxy.ts diff --git a/admin-views/.env b/admin-views/.env new file mode 100644 index 00000000..75d671ad --- /dev/null +++ b/admin-views/.env @@ -0,0 +1,8 @@ +# 公共基础路径 +VITE_BASE_URL=/admin +# 接口前缀 (默认) +VITE_API_PREFIX=/admin-api +# 代理地址, mode != production 时生效 +VITE_PROXY_URL=http://owl-admin.test +# 代理地址是否更改origin +VITE_PROXY_CHANGE_ORIGIN=Y diff --git a/admin-views/index.html b/admin-views/index.html index 87f2a12c..68e132d1 100644 --- a/admin-views/index.html +++ b/admin-views/index.html @@ -35,6 +35,7 @@
+