Merge pull request #56 from DevDengChao/feat/extract-default-login-info

提取默认登录使用的租户与账号密码, 规避潜在的账户泄露问题
This commit is contained in:
芋道源码 2024-06-15 18:18:37 +08:00 committed by GitHub
commit 3f3faaca9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

5
.env
View File

@ -18,3 +18,8 @@ VITE_APP_DOCALERT_ENABLE=true
# 百度统计 # 百度统计
VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
# 默认账户密码
VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123

View File

@ -184,9 +184,9 @@ const loginData = reactive({
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE, captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
loginForm: { loginForm: {
tenantName: '芋道源码', tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '',
username: 'admin', username: import.meta.env.VITE_APP_DEFAULT_LOGIN_USERNAME || '',
password: 'admin123', password: import.meta.env.VITE_APP_DEFAULT_LOGIN_PASSWORD || '',
captchaVerification: '', captchaVerification: '',
rememberMe: true // rememberMe: true //
} }

3
types/env.d.ts vendored
View File

@ -14,6 +14,9 @@ interface ImportMetaEnv {
readonly VITE_DEV: string readonly VITE_DEV: string
readonly VITE_APP_CAPTCHA_ENABLE: string readonly VITE_APP_CAPTCHA_ENABLE: string
readonly VITE_APP_TENANT_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_APP_DOCALERT_ENABLE: string
readonly VITE_BASE_URL: string readonly VITE_BASE_URL: string
readonly VITE_UPLOAD_URL: string readonly VITE_UPLOAD_URL: string