From dc8cab7736e5dd100bdf2e6344d3ad0d803fbe8e Mon Sep 17 00:00:00 2001
From: jishenghua <752718920@qq.com>
Date: Tue, 5 Mar 2024 14:25:38 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=AA=8C=E8=AF=81=E7=A0=81=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jshERP-web/src/views/user/Login.vue | 79 ++++++++++++++++++++------
jshERP-web/src/views/user/Register.vue | 4 +-
2 files changed, 64 insertions(+), 19 deletions(-)
diff --git a/jshERP-web/src/views/user/Login.vue b/jshERP-web/src/views/user/Login.vue
index a8464fc5..8fcd98e9 100644
--- a/jshERP-web/src/views/user/Login.vue
+++ b/jshERP-web/src/views/user/Login.vue
@@ -23,6 +23,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
记住密码
@@ -30,7 +49,7 @@
-
+
{
+ if(res.code == 200){
+ this.randCode = res.data.codeNum;
+ this.randCodeImage = res.data.base64;
+ this.requestCodeSuccess=true
+ }else{
+ this.$message.error(res.data)
+ this.requestCodeSuccess=false
+ }
+ }).catch(()=>{
+ this.requestCodeSuccess=false
+ })
+ },
handleSubmit () {
let that = this
let loginParams = {};
that.loginBtn = true;
// 使用账户密码登陆
if (that.customActiveKey === 'tab1') {
- that.form.validateFields([ 'loginName', 'password' ], { force: true }, (err, values) => {
+ that.form.validateFields([ 'loginName', 'password', 'inputCode' ], { force: true }, (err, values) => {
if (!err) {
- loginParams.loginName = values.loginName
- loginParams.password = md5(values.password)
- if(that.checked) {
- //勾选的时候进行缓存
- Vue.ls.set('cache_loginName', values.loginName)
- Vue.ls.set('cache_password', values.password)
+ if(values.inputCode === this.randCode) {
+ loginParams.loginName = values.loginName
+ loginParams.password = md5(values.password)
+ if(that.checked) {
+ //勾选的时候进行缓存
+ Vue.ls.set('cache_loginName', values.loginName)
+ Vue.ls.set('cache_password', values.password)
+ } else {
+ //没勾选的时候清缓存
+ Vue.ls.remove('cache_loginName')
+ Vue.ls.remove('cache_password')
+ }
+ that.Login(loginParams).then((res) => {
+ this.departConfirm(res, loginParams.loginName)
+ }).catch((err) => {
+ that.requestFailed(err);
+ });
} else {
- //没勾选的时候清缓存
- Vue.ls.remove('cache_loginName')
- Vue.ls.remove('cache_password')
+ this.$notification['error']({
+ message: "提示",
+ description: "验证码错误",
+ duration: 2
+ });
+ this.loginBtn = false
}
- that.Login(loginParams).then((res) => {
- this.departConfirm(res, loginParams.loginName)
- }).catch((err) => {
- that.requestFailed(err);
- });
}else {
that.loginBtn = false;
}
@@ -374,7 +419,7 @@
}
.ant-form-item {
- margin-bottom: 30px;
+ margin-bottom: 16px;
}
.getCaptcha {
diff --git a/jshERP-web/src/views/user/Register.vue b/jshERP-web/src/views/user/Register.vue
index 1f83a9b6..1bd3d38b 100644
--- a/jshERP-web/src/views/user/Register.vue
+++ b/jshERP-web/src/views/user/Register.vue
@@ -217,7 +217,7 @@
handleSubmit() {
this.form.validateFields((err, values) => {
if (!err) {
- if(values.inputCode == this.randCode) {
+ if(values.inputCode === this.randCode) {
let register = {
loginName: values.username,
password: md5(values.password)
@@ -306,7 +306,7 @@
.user-layout-register {
.ant-form-item {
- margin-bottom: 18px;
+ margin-bottom: 16px;
}
& > h3 {