Commit 0de613ab by Lyan

登录修改

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