|
|
@ -25,7 +25,7 @@ |
|
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> |
|
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item prop="code" v-if="captchaOnOff"> |
|
|
<el-form-item prop="code" v-if="captchaEnabled"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="loginForm.code" |
|
|
v-model="loginForm.code" |
|
|
size="large" |
|
|
size="large" |
|
|
@ -91,7 +91,7 @@ const loginRules = { |
|
|
const codeUrl = ref(""); |
|
|
const codeUrl = ref(""); |
|
|
const loading = ref(false); |
|
|
const loading = ref(false); |
|
|
// 验证码开关 |
|
|
// 验证码开关 |
|
|
const captchaOnOff = ref(true); |
|
|
const captchaEnabled = ref(true); |
|
|
// 注册开关 |
|
|
// 注册开关 |
|
|
const register = ref(false); |
|
|
const register = ref(false); |
|
|
const redirect = ref(undefined); |
|
|
const redirect = ref(undefined); |
|
|
@ -117,7 +117,7 @@ function handleLogin() { |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
loading.value = false; |
|
|
loading.value = false; |
|
|
// 重新获取验证码 |
|
|
// 重新获取验证码 |
|
|
if (captchaOnOff.value) { |
|
|
if (captchaEnabled.value) { |
|
|
getCode(); |
|
|
getCode(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -127,8 +127,8 @@ function handleLogin() { |
|
|
|
|
|
|
|
|
function getCode() { |
|
|
function getCode() { |
|
|
getCodeImg().then(res => { |
|
|
getCodeImg().then(res => { |
|
|
captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff; |
|
|
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
|
|
if (captchaOnOff.value) { |
|
|
if (captchaEnabled.value) { |
|
|
codeUrl.value = "data:image/gif;base64," + res.img; |
|
|
codeUrl.value = "data:image/gif;base64," + res.img; |
|
|
loginForm.value.uuid = res.uuid; |
|
|
loginForm.value.uuid = res.uuid; |
|
|
} |
|
|
} |
|
|
|