Commit 0de613ab by Lyan

登录修改

parent dd003837
......@@ -13,7 +13,7 @@
prop='oldPass'
type='password'
:rules="[{required: true,message: '不能为空',},
{ pattern: pwdPattern, message: '密码需要6~16位数字+字母组合',},
{ pattern: pwdPattern, message: '密码长度8-20 位字符,包括数字、大、小写字母、特殊字符中的至少2种',},
{ validator:validatePass,}]">
<el-input type='password' placeholder="请输入原密码" v-model='form.oldPass'></el-input>
</el-form-item>
......@@ -21,7 +21,7 @@
prop='newPass'
type='password'
:rules="[{required: true,message: '不能为空',},
{ pattern: pwdPattern, message: '密码需要6~16位数字+字母组合',},
{ pattern: pwdPattern, message: '密码长度8-20 位字符,包括数字、大、小写字母、特殊字符中的至少2种',},
{ validator:validatePass,}]">
<el-input type='password' placeholder="请输入新密码" v-model='form.newPass'></el-input>
</el-form-item>
......@@ -60,7 +60,10 @@ export default {
newPass:'',
affirmPass:''
},
pwdPattern: /^(?=.*[a-zA-Z])(?=.*[0-9])[A-Za-z0-9]{6,16}$/,
// pwdPattern: /^(?=.*[a-zA-Z])(?=.*[0-9])[A-Za-z0-9]{6,16}$/,
pwdPattern: /^(?![\d]+$)(?![a-z]+$)(?![A-Z]+$)(?![@$!%*#?&]+$)[\da-zA-z@$!%*#?&]{8,20}$/,
}
},
methods: {
......@@ -135,7 +138,7 @@ export default {
.content-from{
padding:0 40px;
width: 70%;
// width: 70%;
.content-from-title{
font-size: 14px;
line-height: 20px;
......@@ -158,6 +161,9 @@ export default {
/deep/.el-input{
font-size: 13px;
}
/deep/.el-input__inner{
width: 70%!important;
}
.smallselect{
......
<template>
<EntryCard title="网站用户登录">
<div class="login">
<div class="entry-login-title">用户名登录</div>
<div class="entry-login-title">
<span :class="{'active':isCardNumberLogin==1}" @click="changeType(1)">条码卡登录</span> | <span :class="{'active':isCardNumberLogin==0}" @click="changeType(0)">账户登录</span>
</div>
<el-form :model="userForm" status-icon ref="userLoginFormRef">
<el-form-item prop="userName"
:rules="[{ required: true, message: '请输入用户名/条码卡号', trigger: 'blur' }]"
:rules="[{ required: true, message:placeholder, trigger: 'blur' }]"
>
<el-input v-model="userForm.userName"
placeholder="请输入用户名/条码卡号"></el-input>
:placeholder="placeholder"></el-input>
</el-form-item>
<el-form-item prop="passWord"
......@@ -155,6 +159,7 @@
<script>
import EntryCard from './entry-card.vue'
import {getUUID} from "@/utils/utils";
import tmggVue from '../Business/copms/tmgg.vue';
export default {
name: "login",
......@@ -176,13 +181,26 @@ export default {
uuid: '',
errorMsg: '',
isAgreeShow:false,
isCardNumberLogin:1,
placeholder:'请输入条码卡号'
}
},
created() {
this.getCaptcha();
},
methods: {
changeType(type){
this.userForm.userName=''
this.userForm.passWord=''
this.userForm.captcha=''
this.isCardNumberLogin=type
if(type==1){
this.placeholder='请输入条码卡号'
}else{
this.placeholder='请输入用户名'
}
},
// 点击注册弹出协议
registerAgreement(){
this.$router.push({name:'register',query:{isAgree:1}})
......@@ -221,7 +239,10 @@ export default {
// }
this.$api.user.login({
...this.userForm,
uuid: this.uuid
uuid: this.uuid,
isCardNumberLogin:this.isCardNumberLogin
}).then(async res => {
console.log(res, !res.success)
if (!res.success) {
......@@ -229,6 +250,7 @@ export default {
this.showUserLoginError = true;
this.getCaptcha();
} else {
localStorage.setItem('TOKEN', res.data.token)
const memberInfo = await this.$api.myManage.memberInfo({id: res.data.id})
console.log(memberInfo)
......@@ -247,6 +269,7 @@ export default {
// localStorage.setItem('gs-user', JSON.stringify({type: 'adminBranch'}))
// this.$router.push({path: '/MyManage/admin/check'})
// }
// userType 1.系统成员 2.手机用户 3.实名认证企业 4.网站用户
if(loginInfo.userType===1){
localStorage.setItem('gs-user', JSON.stringify({type: 1}))
......@@ -261,6 +284,11 @@ export default {
this.$router.push({path: '/MyManage/UnVerify/index'})
localStorage.setItem('gs-user', JSON.stringify({type: 4}))
}
if(res.data.isNeedUpdatePassword==1){
// 需要强制修改密码
this.$message.error('密码不符合规范,请修改密码!')
this.$router.push({name:'changePass'})
}
}
})
......@@ -283,8 +311,21 @@ export default {
font-size: 16px;
font-weight: 500;
color: $theme-color1;
margin-bottom: 44px;
text-align: center;
margin-bottom: 34px;
// text-align: center;
display: flex;
justify-content: space-evenly;
color: #999999;
span{
cursor: pointer;
padding-bottom: 10px;
}
.active{
color: $theme-color1;
font-weight: 600;
border-bottom: 2px solid;
}
}
.el-form {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment