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