登录页去掉验证

This commit is contained in:
2023-11-29 10:12:41 +08:00
parent 1a7e8cfc19
commit de65afef11
7 changed files with 7 additions and 106 deletions

View File

@@ -80,13 +80,6 @@
<!-- 表单 -->
<div class="form-cont">
<el-tabs
class="form"
v-model="loginForm.loginType"
style="float: none">
<el-tab-pane label="账号密码登录" name="uname"></el-tab-pane>
<el-tab-pane label="短信验证码登录" name="sms"></el-tab-pane>
</el-tabs>
<div style="">
<el-form
ref="loginForm"
@@ -106,7 +99,7 @@
</el-input>
</el-form-item>
<!-- 账号密码登录 -->
<div v-if="loginForm.loginType === 'uname'">
<div>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@@ -139,56 +132,6 @@
</el-checkbox>
</div>
<!-- 短信验证码登录 -->
<div v-if="loginForm.loginType === 'sms'">
<el-form-item prop="mobile">
<el-input
v-model="loginForm.mobile"
type="text"
auto-complete="off"
placeholder="请输入手机号">
<!-- <svg-icon
slot="prefix"
icon-class="phone"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<el-form-item prop="mobileCode">
<el-input
v-model="loginForm.mobileCode"
type="text"
auto-complete="off"
placeholder="短信验证码"
class="sms-login-mobile-code-prefix"
@keyup.enter.native="handleLogin">
<!-- <template>
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon" />
</template> -->
<template slot="suffix">
<span
v-if="mobileCodeTimer <= 0"
class="getMobileCode"
@click="getSmsCode"
style="
cursor: pointer;
color: #0b58ff;
font-size: calc(12 * 0.12vh);
line-height: calc(54 * 0.12vh);
padding-right: calc(10 * 0.12vh);
">
获取验证码
</span>
<span v-if="mobileCodeTimer > 0" class="getMobileCode">
{{ mobileCodeTimer }}秒后可重新获取
</span>
</template>
</el-input>
</el-form-item>
</div>
<!-- 下方的登录按钮 -->
<el-form-item
id="button-form-item"
@@ -227,13 +170,6 @@
</div>
</div>
</div>
<!-- 图形验证码 -->
<Verify
ref="verify"
:captcha-type="'blockPuzzle'"
:img-size="{ width: '400px', height: '200px' }"
@success="handleLogin" />
</div>
</template>
@@ -241,7 +177,7 @@
import { sendSmsCode, socialAuthRedirect } from '@/api/login';
import { getTenantIdByName } from '@/api/system/tenant';
import { SystemUserSocialTypeEnum } from '@/utils/constants';
import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi';
import { getTenantEnable } from '@/utils/ruoyi';
import {
getPassword,
getRememberMe,
@@ -269,7 +205,7 @@ export default {
data() {
return {
codeUrl: '',
captchaEnable: true,
captchaEnable: false,
tenantEnable: true,
mobileCodeTimer: 0,
loginForm: {
@@ -347,8 +283,6 @@ export default {
}
});
}
// 验证码开关
this.captchaEnable = getCaptchaEnable();
// 重定向地址
this.redirect = this.$route.query.redirect
? decodeURIComponent(this.$route.query.redirect)
@@ -360,15 +294,7 @@ export default {
},
methods: {
getCode() {
// 情况一,未开启:则直接登录
if (!this.captchaEnable) {
this.handleLogin({});
return;
}
// 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
// 弹出验证码
this.$refs.verify.show();
this.handleLogin({});
},
getCookie() {
const username = getUsername();
@@ -522,4 +448,7 @@ export default {
top: 22%;
}
}
.form-cont {
padding-top: 40px;
}
</style>