数据源前台
parent
7c6ec131a1
commit
e5160f8cef
|
@ -7,10 +7,10 @@
|
|||
<el-form-item prop="password">
|
||||
<el-input v-model="loginForm.password" :prefix-icon="Lock" show-password :placeholder="$t('app.password')"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="captcha" class="login-captcha">-->
|
||||
<!-- <el-input v-model="loginForm.captcha" :placeholder="$t('app.captcha')" :prefix-icon="Key"></el-input>-->
|
||||
<!-- <img :src="captchaBase64" @click="onCaptcha" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item prop="captcha" class="login-captcha" v-if="loginForm.isCaptcha">
|
||||
<el-input v-model="loginForm.captcha" :placeholder="$t('app.captcha')" :prefix-icon="Key"></el-input>
|
||||
<img :src="captchaBase64" @click="onCaptcha" />
|
||||
</el-form-item>
|
||||
<el-form-item class="login-button">
|
||||
<el-button type="primary" @click="onLogin()">{{ $t('app.signIn') }}</el-button>
|
||||
</el-form-item>
|
||||
|
@ -34,7 +34,8 @@ const loginForm = reactive({
|
|||
username: 'admin',
|
||||
password: 'admin',
|
||||
key: '',
|
||||
// captcha: ''
|
||||
captcha: '',
|
||||
isCaptcha: false
|
||||
})
|
||||
|
||||
const loginRules = ref({
|
||||
|
@ -49,8 +50,12 @@ onMounted(() => {
|
|||
|
||||
const onCaptcha = async () => {
|
||||
const { data } = await useCaptchaApi()
|
||||
loginForm.key = data.key
|
||||
captchaBase64.value = data.image
|
||||
if (data==null) {
|
||||
loginForm.isCaptcha = false
|
||||
}else {
|
||||
loginForm.key = data.key
|
||||
captchaBase64.value = data.image
|
||||
}
|
||||
}
|
||||
|
||||
const onLogin = () => {
|
||||
|
|
Loading…
Reference in New Issue