diff --git a/.vscode/settings.json b/.vscode/settings.json index 8b76b276..5b6a6cc7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -223,5 +223,6 @@ "commentTranslate.multiLineMerge": true, "vue.server.hybridMode": true, "typescript.tsdk": "node_modules/typescript/lib", - "oxc.enable": false + "oxc.enable": false, + "cSpell.words": ["Yudao", "xingyu", "xingyuv"] } diff --git a/apps/web-antd/.env b/apps/web-antd/.env index c14a467f..975ea83c 100644 --- a/apps/web-antd/.env +++ b/apps/web-antd/.env @@ -1,5 +1,16 @@ # 应用标题 -VITE_APP_TITLE=Vben Admin Antd +VITE_APP_TITLE=芋道管理系统 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 -VITE_APP_NAMESPACE=vben-web-antd +VITE_APP_NAMESPACE=yudao-vben-antd + +# 租户开关 +VITE_APP_TENANT_ENABLE=true + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=false + +# 默认账户密码 +VITE_APP_DEFAULT_LOGIN_TENANT=芋道源码 +VITE_APP_DEFAULT_LOGIN_USERNAME=admin +VITE_APP_DEFAULT_LOGIN_PASSWORD=admin123 diff --git a/apps/web-antd/.env.development b/apps/web-antd/.env.development index c138f482..3c441c7f 100644 --- a/apps/web-antd/.env.development +++ b/apps/web-antd/.env.development @@ -4,10 +4,10 @@ VITE_PORT=5666 VITE_BASE=/ # 接口地址 -VITE_GLOB_API_URL=/api +VITE_GLOB_API_URL=/admin-api # 是否开启 Nitro Mock服务,true 为开启,false 为关闭 -VITE_NITRO_MOCK=true +VITE_NITRO_MOCK=false # 是否打开 devtools,true 为打开,false 为关闭 VITE_DEVTOOLS=false diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index 5375847a..0a03c27a 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -1,7 +1,7 @@ VITE_BASE=/ # 接口地址 -VITE_GLOB_API_URL=https://mock-napi.vben.pro/api +VITE_GLOB_API_URL=/admin-api # 是否开启压缩,可以设置为 none, brotli, gzip VITE_COMPRESS=none diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index b6360f1d..71ae65bb 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -6,11 +6,11 @@ export default defineConfig(async () => { vite: { server: { proxy: { - '/api': { + '/admin-api': { changeOrigin: true, - rewrite: (path) => path.replace(/^\/api/, ''), + rewrite: (path) => path.replace(/^\/admin-api/, ''), // mock代理目标地址 - target: 'http://localhost:5320/api', + target: 'http://localhost:48080/admin-api', ws: true, }, }, diff --git a/packages/effects/hooks/src/use-app-config.ts b/packages/effects/hooks/src/use-app-config.ts index 857ac7cb..fd2ae74d 100644 --- a/packages/effects/hooks/src/use-app-config.ts +++ b/packages/effects/hooks/src/use-app-config.ts @@ -15,9 +15,12 @@ export function useAppConfig( ? window._VBEN_ADMIN_PRO_APP_CONF_ : (env as VbenAdminProAppConfigRaw); - const { VITE_GLOB_API_URL } = config; + const { VITE_APP_CAPTCHA_ENABLE, VITE_APP_TENANT_ENABLE, VITE_GLOB_API_URL } = + config; return { apiURL: VITE_GLOB_API_URL, + captchaEnable: VITE_APP_CAPTCHA_ENABLE, + tenantEnable: VITE_APP_TENANT_ENABLE, }; } diff --git a/packages/types/global.d.ts b/packages/types/global.d.ts index 0c8f0198..8280443b 100644 --- a/packages/types/global.d.ts +++ b/packages/types/global.d.ts @@ -9,10 +9,14 @@ declare module 'vue-router' { export interface VbenAdminProAppConfigRaw { VITE_GLOB_API_URL: string; + VITE_APP_TENANT_ENABLE: boolean; + VITE_APP_CAPTCHA_ENABLE: boolean; } export interface ApplicationConfig { apiURL: string; + captchaEnable: boolean; + tenantEnable: boolean; } declare global {