|
|
@ -1,55 +1,65 @@ |
|
|
|
<template> |
|
|
|
<div class="login"> |
|
|
|
<div class="logoTitle" style="margin-left: 50px;margin-top: 50px;"> |
|
|
|
<!-- <img src="../../assets/loginImg/shgf.png" |
|
|
|
style="width: 50px;height: 50px; margin-right: 10px;" /><span>汇融惠享</span> |
|
|
|
<p class="title" style="margin-top: 5px;">汇融惠享管理平台</p> --> |
|
|
|
<img src="../../assets/loginImg/yxt-logo.png" style="width: 250px;height:50px; margin-right: 10px;" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="main"> |
|
|
|
<div class="content"> |
|
|
|
<el-form ref="loginForm" :model="loginForm" class="login-form"> |
|
|
|
<h3 class="title1">用户登录</h3> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="loginForm.userName" autocomplete="off" placeholder="请输入账号" prefix-icon="el-icon-user"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock" |
|
|
|
show-password> |
|
|
|
</el-input> |
|
|
|
<!-- <span class="nopsw register" @click="forgetPwd = true">忘记密码 ?</span> --> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="showMsg" style="margin-bottom:0;"> |
|
|
|
<span class="text-danger">提示:用户名或密码错误,请重试!</span> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" class="login-btn" v-loading="loading" @click="login">登 录</el-button> |
|
|
|
<!-- <el-popover placement="top" width="400" trigger="click" v-model="loginCode" @show="codeShow"> |
|
|
|
<imgCodeRole @login="login" ref="imgCodeRole"></imgCodeRole> |
|
|
|
<el-button slot="reference" type="primary" class="login-btn" v-loading="loading">登 录</el-button> |
|
|
|
</el-popover> --> |
|
|
|
<!--<router-link :to="{name: 'registUser'}" target="_blank" tag="a" class="register fl">个人注册</router-link> |
|
|
|
<router-link :to="{name: 'registOrg'}" target="_blank" tag="a" class="register fr">单位注册</router-link>--> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<img src="../../assets/loginImg/login_left.png" style="width:50%;height:100%; " /> |
|
|
|
|
|
|
|
<div class="main-right"> |
|
|
|
|
|
|
|
<span class="main-right-title">欢迎登录商享通WMS</span> |
|
|
|
|
|
|
|
|
|
|
|
<div class="main-right-table"> |
|
|
|
|
|
|
|
<div :class="tableIndex == 1 ? 'main-right-table-text1' : 'main-right-table-text3'" @click="tableClick(1)"> |
|
|
|
密码登录</div> |
|
|
|
<div :class="tableIndex == 2 ? 'main-right-table-text2' : 'main-right-table-text4'" @click="tableClick(2)"> |
|
|
|
验证码登录</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="main-right-table-password" v-show="tableIndex==1"> |
|
|
|
|
|
|
|
<el-input class="input" placeholder="请输入手机号/邮箱" clearable v-model="loginForm.userName" /> |
|
|
|
<el-input class="input" placeholder="请输入密码" type="password" show-password v-model="loginForm.password" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="main-right-table-code" v-show="tableIndex==2"> |
|
|
|
<el-input class="input" placeholder="请输入手机号/邮箱" clearable v-model="loginForm.userName" /> |
|
|
|
<div style="display: flex;flex-direction: row;align-items: center;width: 100%;"> |
|
|
|
<el-input class="input" style="flex: 1; margin-right: 10px;" maxlength="6" placeholder="请输入验证码" |
|
|
|
v-model="loginForm.verifyCode" /> |
|
|
|
<span :class="sendCodeType ? 'sendCode1' : 'sendCode2'" @click="sendCode">{{sendCodeText}}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" style="width: 65%;margin-top: 30px; font-size: 25px;line-height: 40px;" |
|
|
|
@click="login">登录</el-button> |
|
|
|
|
|
|
|
<div class="main-right-bom"> |
|
|
|
|
|
|
|
<el-checkbox class="main-right-bom-left">7天内免登录</el-checkbox> |
|
|
|
|
|
|
|
<div class="main-right-bom-right"> |
|
|
|
|
|
|
|
<span>忘记密码</span> |
|
|
|
<div style="margin-left: 8px;margin-right: 8px;width: 1px; height: 18px;background: #999;"></div> |
|
|
|
<span>去注册</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-dialog title="忘记密码" :visible.sync="forgetPwd"> |
|
|
|
<el-form :model="nopassword"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-input v-model="nopassword.userPhone" autocomplete="off"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户名"> |
|
|
|
<el-input v-model="nopassword.userName" autocomplete="off"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="forgetPwd = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="reGetPwd()">确 定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -74,9 +84,17 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableIndex: 1, |
|
|
|
sendCodeText: "发送验证码", |
|
|
|
sendCodeType: false, |
|
|
|
totalTime: 10, //一般是60 |
|
|
|
timer: '', //定时器 |
|
|
|
|
|
|
|
loginForm: { |
|
|
|
userName: '', |
|
|
|
password: '', |
|
|
|
verifyCode: "", |
|
|
|
type: "1" |
|
|
|
}, |
|
|
|
imgCode: '', |
|
|
|
loading: false, |
|
|
@ -90,37 +108,72 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
tableClick(index) { |
|
|
|
this.tableIndex = index |
|
|
|
|
|
|
|
this.loginForm.type = index + "" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 验证码倒计时 |
|
|
|
sendCode() { |
|
|
|
if (this.sendCodeType) return |
|
|
|
// this.getCode() // 获取验证码的接口 |
|
|
|
this.sendCodeType = true |
|
|
|
this.sendCodeText = this.totalTime + 's' |
|
|
|
this.timer = setInterval(() => { |
|
|
|
this.totalTime-- |
|
|
|
this.sendCodeText = this.totalTime + 's' |
|
|
|
if (this.totalTime < 0) { |
|
|
|
clearInterval(this.timer) |
|
|
|
this.sendCodeText = '发送验证码' |
|
|
|
this.totalTime = 10 |
|
|
|
this.sendCodeType = false |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
}, |
|
|
|
|
|
|
|
login() { |
|
|
|
console.log(66222222222222222222222222222); |
|
|
|
// doLogin(this.loginForm).then((response) => { |
|
|
|
// if (response.code == 200) { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
doLogin(this.loginForm).then((response) => { |
|
|
|
if (response.code == 200) { |
|
|
|
this.$router.push({ |
|
|
|
path: '/index' |
|
|
|
}) |
|
|
|
this.loading = true |
|
|
|
// // this.getUserInfo(response.data.loginId) |
|
|
|
// window.sessionStorage.setItem('tokenName', response.data.tokenName) |
|
|
|
// window.sessionStorage.setItem('tokenValue', response.data.tokenValue) |
|
|
|
// } |
|
|
|
loading.close() |
|
|
|
// this.getUserInfo(response.data.loginId) |
|
|
|
window.sessionStorage.setItem('token', response.data.token) |
|
|
|
window.sessionStorage.setItem('sid', response.data.sid) |
|
|
|
window.sessionStorage.setItem('staffSid', response.data.staffSid) |
|
|
|
window.sessionStorage.setItem('userName', response.data.userName) |
|
|
|
|
|
|
|
console.log(" token", sessionStorage.getItem('token')) |
|
|
|
}else{ |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
|
|
|
|
// }).catch(() => { |
|
|
|
// this.loading = true |
|
|
|
// }) |
|
|
|
}).catch(() => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
getUserInfo(id) { |
|
|
|
getUserById(id).then((response) => { |
|
|
|
if (response.code == 200) { |
|
|
|
console.log(" response", response) |
|
|
|
let user = response.data |
|
|
|
// 结果存入缓存 |
|
|
|
window.sessionStorage.setItem('staffSid', user.staffSid) |
|
|
|
window.sessionStorage.setItem('sid', user.sid) |
|
|
|
window.sessionStorage.setItem('userName', user.userName) |
|
|
|
let user = response.data |
|
|
|
// 结果存入缓存 |
|
|
|
window.sessionStorage.setItem('staffSid', user.staffSid) |
|
|
|
window.sessionStorage.setItem('sid', user.sid) |
|
|
|
window.sessionStorage.setItem('userName', user.userName) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
codeShow() { |
|
|
@ -140,140 +193,190 @@ |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
.el-input__inner { |
|
|
|
border: none; |
|
|
|
color: #000; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
|
|
|
|
input:-webkit-autofill { |
|
|
|
-webkit-box-shadow: 0 0 0px 1000px white inset; |
|
|
|
-webkit-text-fill-color: #000; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login { |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
background-size: 100% 100%; |
|
|
|
background-image: url(../../assets/home/bj.jpg); |
|
|
|
background-image: url(../../assets/home/bj.png); |
|
|
|
background-position: center; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
.logoTitle { |
|
|
|
margin: 30px; |
|
|
|
|
|
|
|
img { |
|
|
|
width: 70px; |
|
|
|
} |
|
|
|
|
|
|
|
span { |
|
|
|
font-size: 40px; |
|
|
|
color: #191919; |
|
|
|
} |
|
|
|
|
|
|
|
.title { |
|
|
|
font-size: 25px; |
|
|
|
font-family: Source Han Sans CN; |
|
|
|
font-weight: 500; |
|
|
|
color: #191919; |
|
|
|
margin: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.main { |
|
|
|
width: 30%; |
|
|
|
/*height: 640px;*/ |
|
|
|
width: 60%; |
|
|
|
height: 500px; |
|
|
|
background: #ffffff; |
|
|
|
box-shadow: 0px 13px 12px 0px rgba(0, 0, 0, 0.15); |
|
|
|
opacity: 0.8; |
|
|
|
border-radius: 20px; |
|
|
|
border-radius: 5px; |
|
|
|
position: absolute; |
|
|
|
right: 15%; |
|
|
|
top:35%; |
|
|
|
|
|
|
|
.content { |
|
|
|
position: relative; |
|
|
|
/*.title-h3{ |
|
|
|
width: 100%; |
|
|
|
text-align: center; |
|
|
|
color: #FFFFFF; |
|
|
|
font-size: 30px; |
|
|
|
margin: 0; |
|
|
|
position: absolute; |
|
|
|
top: -65px; |
|
|
|
|
|
|
|
}*/ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
right: 20%; |
|
|
|
top: 25%; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
|
|
|
|
.login-form { |
|
|
|
padding: 30px 50px; |
|
|
|
.main-right { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
width: 50%; |
|
|
|
height: 100%; |
|
|
|
|
|
|
|
.title1 { |
|
|
|
margin: 0px auto 30px auto; |
|
|
|
text-align: center; |
|
|
|
font-size: 20px; |
|
|
|
color: #191919; |
|
|
|
font-size: 23px; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
.main-right-title { |
|
|
|
margin-top: 40px; |
|
|
|
font-size: 24px; |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
|
|
|
|
.el-input { |
|
|
|
border: none; |
|
|
|
background-color: transparent; |
|
|
|
} |
|
|
|
.main-right-table { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
align-items: center; |
|
|
|
margin-top: 30px; |
|
|
|
width: 70%; |
|
|
|
|
|
|
|
.code { |
|
|
|
position: absolute; |
|
|
|
top: 3px; |
|
|
|
right: 5px; |
|
|
|
width: 35%; |
|
|
|
height: 35px; |
|
|
|
cursor: pointer; |
|
|
|
z-index: 9; |
|
|
|
} |
|
|
|
.main-right-table-text1 { |
|
|
|
flex: 1; |
|
|
|
font-size: 22px; |
|
|
|
text-align: center; |
|
|
|
color: #3E77CD; |
|
|
|
} |
|
|
|
|
|
|
|
.nopsw { |
|
|
|
position: absolute; |
|
|
|
bottom: -30px; |
|
|
|
right: 5px; |
|
|
|
color: #018ad2; |
|
|
|
font-size: 15px; |
|
|
|
line-height: 30px; |
|
|
|
} |
|
|
|
.main-right-table-text1:after { |
|
|
|
content: ''; |
|
|
|
display: block; |
|
|
|
width: 60px; |
|
|
|
border-bottom: 2px solid #3E77CD; |
|
|
|
margin: 0 auto; |
|
|
|
padding-bottom: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.register { |
|
|
|
color: #EE640C; |
|
|
|
} |
|
|
|
|
|
|
|
.register:hover, |
|
|
|
.nopsw:hover { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.main-right-table-text3 { |
|
|
|
flex: 1; |
|
|
|
font-size: 22px; |
|
|
|
text-align: center; |
|
|
|
color: #333; |
|
|
|
border-bottom: none; |
|
|
|
padding-bottom: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-eye { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.main-right-table-text2 { |
|
|
|
flex: 1; |
|
|
|
font-size: 22px; |
|
|
|
text-align: center; |
|
|
|
color: #3E77CD; |
|
|
|
} |
|
|
|
|
|
|
|
.text-danger { |
|
|
|
color: #f56c6c; |
|
|
|
} |
|
|
|
.main-right-table-text2:after { |
|
|
|
content: ''; |
|
|
|
display: block; |
|
|
|
width: 80px; |
|
|
|
border-bottom: 2px solid #3E77CD; |
|
|
|
margin: 0 auto; |
|
|
|
padding-bottom: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.login-btn { |
|
|
|
margin: 10px 0 10px 0; |
|
|
|
width: 100%; |
|
|
|
background-color: #EE640C; |
|
|
|
border: 0; |
|
|
|
} |
|
|
|
.main-right-table-text4 { |
|
|
|
flex: 1; |
|
|
|
font-size: 22px; |
|
|
|
text-align: center; |
|
|
|
color: #333; |
|
|
|
border-bottom: none; |
|
|
|
padding-bottom: 8px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.login-btn:hover { |
|
|
|
background-color: #EE640C; |
|
|
|
border: 0; |
|
|
|
} |
|
|
|
.main-right-table-password { |
|
|
|
display: flex; |
|
|
|
width: 65%; |
|
|
|
margin-top: 10px; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
.input { |
|
|
|
margin-top: 10px; |
|
|
|
width: 100%; |
|
|
|
height: 45px; |
|
|
|
border-bottom: 1px #ccc solid; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.main-right-table-code { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
width: 65%; |
|
|
|
margin-top: 10px; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
.input { |
|
|
|
margin-top: 10px; |
|
|
|
width: 100%; |
|
|
|
height: 45px; |
|
|
|
border-bottom: 1px #ccc solid; |
|
|
|
} |
|
|
|
|
|
|
|
.sendCode1 { |
|
|
|
font-size: 16px; |
|
|
|
color: #c9c9c9; |
|
|
|
} |
|
|
|
|
|
|
|
.sendCode2 { |
|
|
|
font-size: 16px; |
|
|
|
color: #3E77CD; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.main-right-bom { |
|
|
|
padding-left: 10px; |
|
|
|
padding-right: 10px; |
|
|
|
display: flex; |
|
|
|
width: 65%; |
|
|
|
margin-top: 10px; |
|
|
|
flex-direction: row; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
.main-right-bom-left { |
|
|
|
color: #000; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.main-right-bom-right { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
span { |
|
|
|
color: #666; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.el-input--prefix .el-input__inner { |
|
|
|
border: 1px solid #EE640C; |
|
|
|
background: transparent; |
|
|
|
color: #333 !important; |
|
|
|
} |
|
|
|
|
|
|
|
.el-form-item { |
|
|
|
margin-bottom: 40px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-loading-mask { |
|
|
|
background-color: rgba(255, 255, 255, 0.6); |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|