chore: v5 init

pull/48/MERGE
xingyuv 2024-11-16 22:33:47 +08:00
parent b87d41bada
commit 64ed920646
7 changed files with 29 additions and 10 deletions

View File

@ -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"]
}

View File

@ -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

View File

@ -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
# 是否打开 devtoolstrue 为打开false 为关闭
VITE_DEVTOOLS=false

View File

@ -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

View File

@ -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,
},
},

View File

@ -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,
};
}

View File

@ -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 {