From f202e1c69c06d07fe6c2d3d3d8c1ac8b0bb5c122 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 22 Apr 2025 21:18:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor=EF=BC=9A=E4=BC=98=E5=8C=96=20VITE=5FAP?= =?UTF-8?q?P=5FTENANT=5FENABLE=E3=80=81VITE=5FAPP=5FCAPTCHA=5FENABLE=20?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=9A=84=E5=8A=A0=E8=BD=BD=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20useAppConfig=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/.env.development | 2 +- apps/web-antd/.env.production | 4 +- apps/web-antd/src/api/request.ts | 5 +- .../src/components/doc-alert/doc-alert.vue | 11 +-- .../src/components/upload/use-upload.ts | 93 +++++++++++-------- .../views/_core/authentication/code-login.vue | 5 +- .../_core/authentication/forget-password.vue | 4 +- .../src/views/_core/authentication/login.vue | 10 +- .../views/_core/authentication/register.vue | 15 ++- .../_core/authentication/social-login.vue | 9 +- apps/web-antd/src/views/infra/druid/index.vue | 1 - packages/effects/hooks/src/use-app-config.ts | 18 +++- packages/types/global.d.ts | 4 - 13 files changed, 93 insertions(+), 88 deletions(-) diff --git a/apps/web-antd/.env.development b/apps/web-antd/.env.development index 4b4e441c9..cff255764 100644 --- a/apps/web-antd/.env.development +++ b/apps/web-antd/.env.development @@ -4,7 +4,7 @@ VITE_PORT=5666 VITE_BASE=/ # 请求路径 -VITE_BASE_URL='http://127.0.0.1:48080' +VITE_BASE_URL=http://127.0.0.1:48080 # 接口地址 VITE_GLOB_API_URL=/admin-api # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index ab51fee83..910fd64cc 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -1,9 +1,9 @@ VITE_BASE=/ # 请求路径 -VITE_BASE_URL='http://127.0.0.1:48080' +VITE_BASE_URL=http://127.0.0.1:48080 # 接口地址 -VITE_GLOB_API_URL=/admin-api +VITE_GLOB_API_URL=http://127.0.0.1:48080/admin-api # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/apps/web-antd/src/api/request.ts b/apps/web-antd/src/api/request.ts index 8c36097ff..fcefa2508 100644 --- a/apps/web-antd/src/api/request.ts +++ b/apps/web-antd/src/api/request.ts @@ -3,7 +3,7 @@ */ import type { RequestClientOptions } from '@vben/request'; -import { useAppConfig } from '@vben/hooks'; +import { isTenantEnable, useAppConfig } from '@vben/hooks'; import { preferences } from '@vben/preferences'; import { authenticateResponseInterceptor, @@ -19,7 +19,8 @@ import { useAuthStore } from '#/store'; import { refreshTokenApi } from './core'; -const { apiURL, tenantEnable } = useAppConfig(import.meta.env, import.meta.env.PROD); +const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); +const tenantEnable = isTenantEnable(); function createRequestClient(baseURL: string, options?: RequestClientOptions) { const client = new RequestClient({ diff --git a/apps/web-antd/src/components/doc-alert/doc-alert.vue b/apps/web-antd/src/components/doc-alert/doc-alert.vue index 1cff7b990..66b6fcd1d 100644 --- a/apps/web-antd/src/components/doc-alert/doc-alert.vue +++ b/apps/web-antd/src/components/doc-alert/doc-alert.vue @@ -1,6 +1,6 @@