|
@ -1,8 +1,9 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="login"> |
|
|
<div class="login"> |
|
|
<div class="logoTitle"> |
|
|
<div class="logoTitle" style="margin-left: 50px;margin-top: 50px;"> |
|
|
<img src="../../assets/loginImg/logo.png" /><span>贷后监管</span> |
|
|
<img src="../../assets/loginImg/cyf_logo.jpg" |
|
|
<p class="title">贷后监管体系</p> |
|
|
style="width: 50px;height: 50px; margin-right: 10px;" /><span>醇油坊</span> |
|
|
|
|
|
<p class="title" style="margin-top: 5px;">醇油坊进销存管理平台</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="main"> |
|
|
<div class="main"> |
|
|
<div class="content"> |
|
|
<div class="content"> |
|
@ -13,18 +14,21 @@ |
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock" show-password> |
|
|
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock" |
|
|
|
|
|
show-password> |
|
|
</el-input> |
|
|
</el-input> |
|
|
<span class="nopsw register" @click="forgetPwd = true">忘记密码 ?</span> |
|
|
<span class="nopsw register" @click="forgetPwd = true">忘记密码 ?</span> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-show="showMsg" style="margin-bottom:0;"> |
|
|
<el-form-item v-show="showMsg" style="margin-bottom:0;"> |
|
|
<span class="text-danger">提示:用户名或密码错误,请重试!</span> |
|
|
<span class="text-danger">提示:用户名或密码错误,请重试!</span> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-popover placement="top" width="400" trigger="click" v-model="loginCode" @show="codeShow"> |
|
|
<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> |
|
|
<imgCodeRole @login="login" ref="imgCodeRole"></imgCodeRole> |
|
|
<el-button slot="reference" type="primary" class="login-btn" v-loading="loading">登 录</el-button> |
|
|
<el-button slot="reference" type="primary" class="login-btn" v-loading="loading">登 录</el-button> |
|
|
</el-popover> |
|
|
</el-popover> --> |
|
|
<!--<router-link :to="{name: 'registUser'}" target="_blank" tag="a" class="register fl">个人注册</router-link> |
|
|
<!--<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>--> |
|
|
<router-link :to="{name: 'registOrg'}" target="_blank" tag="a" class="register fr">单位注册</router-link>--> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -51,104 +55,154 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { login, imgCode } from '@/api/user.js' |
|
|
import { |
|
|
import user from '@/api/User/login.js' |
|
|
doLogin, |
|
|
import { setToken, getToken, setSession } from '@/utils/auth' |
|
|
getUserById, |
|
|
import imgCodeRole from '@/components/imgCodeRole/index.vue' |
|
|
imgCode |
|
|
import qs from 'qs' |
|
|
} from '@/api/user.js' |
|
|
export default { |
|
|
import user from '@/api/User/login.js' |
|
|
components: { imgCodeRole }, |
|
|
import { |
|
|
data() { |
|
|
setToken, |
|
|
return { |
|
|
getToken, |
|
|
loginForm: { |
|
|
setSession |
|
|
userName: '', |
|
|
} from '@/utils/auth' |
|
|
password: '', |
|
|
import imgCodeRole from '@/components/imgCodeRole/index.vue' |
|
|
verifyCode: '', |
|
|
import qs from 'qs' |
|
|
uuid: '', |
|
|
export default { |
|
|
}, |
|
|
components: { |
|
|
imgCode: '', |
|
|
imgCodeRole |
|
|
loading: false, |
|
|
|
|
|
loginCode: false, |
|
|
|
|
|
showMsg: false, |
|
|
|
|
|
forgetPwd: false, |
|
|
|
|
|
nopassword: { |
|
|
|
|
|
userPhone: '', |
|
|
|
|
|
userName: '', |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
login(data) { |
|
|
|
|
|
this.loading = true |
|
|
|
|
|
this.loginForm.verifyCode = data.verifyCode |
|
|
|
|
|
this.loginForm.uuid = data.uuid |
|
|
|
|
|
this.$store |
|
|
|
|
|
.dispatch('user/login', this.loginForm) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
// this.$setStorage.dispatch('user/getInfo') |
|
|
|
|
|
this.$router.push({ path: '/home' }) |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.$refs.imgCodeRole.getCodeImage() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
codeShow() { |
|
|
data() { |
|
|
if (this.loginForm.password == '' || this.loginForm.userName == '') { |
|
|
return { |
|
|
this.loginCode = false |
|
|
loginForm: { |
|
|
this.showMsg = true |
|
|
userName: '', |
|
|
return |
|
|
password: '', |
|
|
|
|
|
}, |
|
|
|
|
|
imgCode: '', |
|
|
|
|
|
loading: false, |
|
|
|
|
|
loginCode: false, |
|
|
|
|
|
showMsg: false, |
|
|
|
|
|
forgetPwd: false, |
|
|
|
|
|
nopassword: { |
|
|
|
|
|
userPhone: '', |
|
|
|
|
|
userName: '', |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
this.$refs.imgCodeRole.getCodeImage() |
|
|
|
|
|
}, |
|
|
}, |
|
|
reGetPwd() { |
|
|
methods: { |
|
|
user.reGetPwd(this.nopassword).then((res) => {}) |
|
|
login() { |
|
|
|
|
|
|
|
|
|
|
|
doLogin(this.loginForm).then((response) => { |
|
|
|
|
|
if (response.code == 200) { |
|
|
|
|
|
console.log(" response", response) |
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
path: '/index' |
|
|
|
|
|
}) |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.getUserInfo(response.data.loginId) |
|
|
|
|
|
window.sessionStorage.setItem('tokenName', response.data.tokenName) |
|
|
|
|
|
window.sessionStorage.setItem('tokenValue', response.data.tokenValue) |
|
|
|
|
|
|
|
|
|
|
|
console.log(" tokenName", response.data.tokenName) |
|
|
|
|
|
console.log(" tokenValue", response.data.tokenValue) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// this.loading = true |
|
|
|
|
|
// this.loginForm.verifyCode = data.verifyCode |
|
|
|
|
|
// this.loginForm.uuid = data.uuid |
|
|
|
|
|
// this.$store |
|
|
|
|
|
// .dispatch('user/login', this.loginForm) |
|
|
|
|
|
// .then((res) => { |
|
|
|
|
|
// // this.$setStorage.dispatch('user/getInfo') |
|
|
|
|
|
// this.$router.push({ |
|
|
|
|
|
// path: '/home' |
|
|
|
|
|
// }) |
|
|
|
|
|
// this.loading = false |
|
|
|
|
|
// }) |
|
|
|
|
|
// .catch(() => { |
|
|
|
|
|
// this.loading = false |
|
|
|
|
|
// this.$refs.imgCodeRole.getCodeImage() |
|
|
|
|
|
// }) |
|
|
|
|
|
}, |
|
|
|
|
|
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) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
codeShow() { |
|
|
|
|
|
if (this.loginForm.password == '' || this.loginForm.userName == '') { |
|
|
|
|
|
this.loginCode = false |
|
|
|
|
|
this.showMsg = true |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.imgCodeRole.getCodeImage() |
|
|
|
|
|
}, |
|
|
|
|
|
reGetPwd() { |
|
|
|
|
|
user.reGetPwd(this.nopassword).then((res) => {}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
.login { |
|
|
.login { |
|
|
position: relative; |
|
|
position: relative; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
background-size: 100% 100%; |
|
|
background-size: 100% 100%; |
|
|
background-image: url(../../assets/loginImg/bgImg.png); |
|
|
background-image: url(../../assets/home/bj.jpg); |
|
|
background-position: center; |
|
|
background-position: center; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
.logoTitle { |
|
|
|
|
|
margin: 30px; |
|
|
.logoTitle { |
|
|
img { |
|
|
margin: 30px; |
|
|
width: 70px; |
|
|
|
|
|
} |
|
|
img { |
|
|
span { |
|
|
width: 70px; |
|
|
font-size: 40px; |
|
|
} |
|
|
color: #191919; |
|
|
|
|
|
} |
|
|
span { |
|
|
.title { |
|
|
font-size: 40px; |
|
|
font-size: 25px; |
|
|
color: #191919; |
|
|
font-family: Source Han Sans CN; |
|
|
} |
|
|
font-weight: 500; |
|
|
|
|
|
color: #191919; |
|
|
.title { |
|
|
margin: 0; |
|
|
font-size: 25px; |
|
|
|
|
|
font-family: Source Han Sans CN; |
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
color: #191919; |
|
|
|
|
|
margin: 0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.main { |
|
|
.main { |
|
|
width: 30%; |
|
|
width: 30%; |
|
|
/*height: 640px;*/ |
|
|
/*height: 640px;*/ |
|
|
background: #ffffff; |
|
|
background: #ffffff; |
|
|
box-shadow: 0px 13px 12px 0px rgba(0, 0, 0, 0.15); |
|
|
box-shadow: 0px 13px 12px 0px rgba(0, 0, 0, 0.15); |
|
|
opacity: 0.9; |
|
|
opacity: 0.9; |
|
|
border-radius: 20px; |
|
|
border-radius: 20px; |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
right: 10%; |
|
|
right: 10%; |
|
|
|
|
|
|
|
|
.content { |
|
|
.content { |
|
|
position: relative; |
|
|
position: relative; |
|
|
/*.title-h3{ |
|
|
/*.title-h3{ |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
color: #FFFFFF; |
|
|
color: #FFFFFF; |
|
@ -158,75 +212,87 @@ export default { |
|
|
top: -65px; |
|
|
top: -65px; |
|
|
|
|
|
|
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.login-form { |
|
|
|
|
|
padding: 30px 50px; |
|
|
|
|
|
.title1 { |
|
|
|
|
|
margin: 0px auto 30px auto; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
font-size: 20px; |
|
|
|
|
|
color: #191919; |
|
|
|
|
|
font-size: 23px; |
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
} |
|
|
|
|
|
.el-input { |
|
|
|
|
|
border: none; |
|
|
|
|
|
background-color: transparent; |
|
|
|
|
|
} |
|
|
|
|
|
.code { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 3px; |
|
|
|
|
|
right: 5px; |
|
|
|
|
|
width: 35%; |
|
|
|
|
|
height: 35px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
z-index: 9; |
|
|
|
|
|
} |
|
|
|
|
|
.nopsw { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
bottom: -30px; |
|
|
|
|
|
right: 5px; |
|
|
|
|
|
color: #018ad2; |
|
|
|
|
|
font-size: 15px; |
|
|
|
|
|
line-height: 30px; |
|
|
|
|
|
} |
|
|
|
|
|
.register { |
|
|
|
|
|
color: #018ad2; |
|
|
|
|
|
} |
|
|
|
|
|
.register:hover, |
|
|
|
|
|
.nopsw:hover { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
.btn-eye { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.text-danger { |
|
|
.login-form { |
|
|
color: #f56c6c; |
|
|
padding: 30px 50px; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login-btn { |
|
|
.title1 { |
|
|
margin: 10px 0 10px 0; |
|
|
margin: 0px auto 30px auto; |
|
|
width: 100%; |
|
|
text-align: center; |
|
|
background-color: #007fff; |
|
|
font-size: 20px; |
|
|
border: 0; |
|
|
color: #191919; |
|
|
} |
|
|
font-size: 23px; |
|
|
.login-btn:hover { |
|
|
font-weight: 500; |
|
|
background-color: #007fdd; |
|
|
} |
|
|
border: 0; |
|
|
|
|
|
} |
|
|
.el-input { |
|
|
.el-input--prefix .el-input__inner { |
|
|
border: none; |
|
|
border: 1px solid #018ad2; |
|
|
background-color: transparent; |
|
|
background: transparent; |
|
|
} |
|
|
color: #333 !important; |
|
|
|
|
|
} |
|
|
.code { |
|
|
.el-form-item { |
|
|
position: absolute; |
|
|
margin-bottom: 40px; |
|
|
top: 3px; |
|
|
} |
|
|
right: 5px; |
|
|
.el-loading-mask { |
|
|
width: 35%; |
|
|
background-color: rgba(255, 255, 255, 0.6); |
|
|
height: 35px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
z-index: 9; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nopsw { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
bottom: -30px; |
|
|
|
|
|
right: 5px; |
|
|
|
|
|
color: #018ad2; |
|
|
|
|
|
font-size: 15px; |
|
|
|
|
|
line-height: 30px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.register { |
|
|
|
|
|
color: #018ad2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.register:hover, |
|
|
|
|
|
.nopsw:hover { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.btn-eye { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.text-danger { |
|
|
|
|
|
color: #f56c6c; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login-btn { |
|
|
|
|
|
margin: 10px 0 10px 0; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
background-color: #007fff; |
|
|
|
|
|
border: 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login-btn:hover { |
|
|
|
|
|
background-color: #007fdd; |
|
|
|
|
|
border: 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-input--prefix .el-input__inner { |
|
|
|
|
|
border: 1px solid #018ad2; |
|
|
|
|
|
background: transparent; |
|
|
|
|
|
color: #333 !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-form-item { |
|
|
|
|
|
margin-bottom: 40px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-loading-mask { |
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.6); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
</style> |
|
|
</style> |
|
|