登录页面 滑动验证和禁止滚动优化

ywj_dev
CTP 2 years ago
parent 486da451f0
commit fd2e7c35ad

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 供应商自助管理系统
VUE_APP_TITLE = 供应商自助管理平台
# 开发环境配置
ENV = 'development'

@ -95,13 +95,13 @@
style="
position: absolute;
bottom: 0;
margin-left: 36%;
font-size: 18px;
margin-left: 20%;
font-size: 12px;
color: white;
"
>
<a href="http://www.xmglxp.com/" target="_blank">
软件名称: 医院UDI管理系统
软件名称: 医院UDI管理平台
</a>
<a
href="http://www.xmglxp.com/"
@ -158,6 +158,7 @@ export default {
};
},
methods: {
//
verifyAlert(text) {
if (text === "success") {
this.loginForm.verificationCode = true;
@ -165,7 +166,7 @@ export default {
this.loginForm.verificationCode = false;
}
},
// handleLogin() {
/* // handleLogin() {
// if (!this.ruleForm.verificationCode) {
// this.$message({
// message: '',
@ -208,7 +209,7 @@ export default {
// return false;
// }
// });
// },
// }, */
getCookie() {
const username = Cookies.get("username");
@ -224,33 +225,41 @@ export default {
handleLogin() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
// Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
if (this.loginForm.verificationCode) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
// Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
} else {
Cookies.remove("username");
Cookies.remove("password");
// Cookies.remove('rememberMe');
}
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
this.$router
.push({ path: this.redirect || "/" })
.catch((res) => {});
})
.catch((res) => {
this.loading = false;
this.$refs.checkV.refresh();
this.$message.error(res);
if (this.captchaEnabled) {
this.getCode();
}
});
} else {
Cookies.remove("username");
Cookies.remove("password");
// Cookies.remove('rememberMe');
}
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
this.$router
.push({ path: this.redirect || "/" })
.catch((res) => {});
})
.catch((res) => {
this.loading = false;
this.$refs.checkV.refresh();
this.$message.error(res);
if (this.captchaEnabled) {
this.getCode();
}
this.$message({
message: "请向右滑动完成验证",
type: "warning",
});
}
}
});
},
@ -287,6 +296,7 @@ $light_gray: #eee;
background-image: url("../assets/login.jpg");
background-size: 100vw 100vh;
height: 100%;
overflow: hidden;
input:-webkit-autofill,
input:-webkit-autofill:hover,

Loading…
Cancel
Save