vue3 验证码,增加开关

This commit is contained in:
YunaiV 2022-09-04 12:35:23 +08:00
parent 1a48301cee
commit b134492fa9
3 changed files with 14 additions and 2 deletions

View File

@ -9,3 +9,6 @@ VITE_OPEN=true
# 租户开关 # 租户开关
VITE_APP_TENANT_ENABLE=true VITE_APP_TENANT_ENABLE=true
# 验证码的开关
VITE_APP_CAPTCHA_ENABLE=false

View File

@ -51,8 +51,8 @@ const LoginRules = {
const loginLoading = ref(false) const loginLoading = ref(false)
const loginData = reactive({ const loginData = reactive({
isShowPassword: false, isShowPassword: false,
captchaEnable: true, captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: true, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
token: '', token: '',
loading: { loading: {
signIn: false signIn: false
@ -71,6 +71,14 @@ const captchaType = ref('blockPuzzle')
// //
const getCode = async () => { const getCode = async () => {
//
if (!loginData.captchaEnable) {
await handleLogin({})
return
}
//
//
verify.value.show() verify.value.show()
} }
//ID //ID

View File

@ -11,6 +11,7 @@ interface ImportMetaEnv {
readonly VITE_APP_TITLE: string readonly VITE_APP_TITLE: string
readonly VITE_PORT: number readonly VITE_PORT: number
readonly VITE_OPEN: boolean readonly VITE_OPEN: boolean
readonly VITE_APP_CAPTCHA_ENABLE: boolean
readonly VITE_APP_TENANT_ENABLE: boolean readonly VITE_APP_TENANT_ENABLE: boolean
readonly VITE_BASE_URL: string readonly VITE_BASE_URL: string
readonly VITE_UPLOAD_URL: string readonly VITE_UPLOAD_URL: string