Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提取默认登录使用的租户与账号密码, 规避潜在的账户泄露问题 #56

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/views/Login/components/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 // 默认记录我。如果不需要,可手动修改
}
Expand Down
3 changes: 3 additions & 0 deletions types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down