From d883b860acfe01da575fa1b4662c15d2180ea7b9 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Tue, 21 May 2024 17:43:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8F=90=E5=8F=96=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=99=BB=E5=BD=95=E4=BD=BF=E7=94=A8=E7=9A=84=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E4=B8=8E=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81,=20?= =?UTF-8?q?=E8=A7=84=E9=81=BF=E6=BD=9C=E5=9C=A8=E7=9A=84=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E6=B3=84=E9=9C=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 5 +++++ src/views/Login/components/LoginForm.vue | 6 +++--- types/env.d.ts | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 424b022b..4b0f5bf6 100644 --- a/.env +++ b/.env @@ -18,3 +18,8 @@ VITE_APP_DOCALERT_ENABLE=true # 百度统计 VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc + +# 默认账户密码 +VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码 +VITE_APP_DEFAULT_LOGIN_USERNAME = admin +VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123 diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index e61ccbe9..3dbaff3f 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -184,9 +184,9 @@ const loginData = reactive({ captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE, loginForm: { - tenantName: '芋道源码', - username: 'admin', - password: 'admin123', + tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '', + username: import.meta.env.VITE_APP_DEFAULT_LOGIN_USERNAME || '', + password: import.meta.env.VITE_APP_DEFAULT_LOGIN_PASSWORD || '', captchaVerification: '', rememberMe: true // 默认记录我。如果不需要,可手动修改 } diff --git a/types/env.d.ts b/types/env.d.ts index 057b5268..1326e3b4 100644 --- a/types/env.d.ts +++ b/types/env.d.ts @@ -14,6 +14,9 @@ interface ImportMetaEnv { readonly VITE_DEV: string readonly VITE_APP_CAPTCHA_ENABLE: string readonly VITE_APP_TENANT_ENABLE: string + readonly VITE_APP_DEFAULT_LOGIN_TENANT: string + readonly VITE_APP_DEFAULT_LOGIN_USERNAME: string + readonly VITE_APP_DEFAULT_LOGIN_PASSWORD: string readonly VITE_APP_DOCALERT_ENABLE: string readonly VITE_BASE_URL: string readonly VITE_UPLOAD_URL: string