xg
This commit is contained in:
parent
766ee13f13
commit
4975b0f093
@ -1,71 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<el-form
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||||
ref="loginForm"
|
<div class="toptitleimg">
|
||||||
:model="loginForm"
|
|
||||||
:rules="loginRules"
|
|
||||||
class="login-form"
|
|
||||||
>
|
|
||||||
<img class="imgitem" src="../assets/images/logo.png" alt="" />
|
<img class="imgitem" src="../assets/images/logo.png" alt="" />
|
||||||
<h3 class="title">健康管理运维端</h3>
|
<h3 class="toptitle">健康管理运维端</h3>
|
||||||
|
</div>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||||
v-model="loginForm.username"
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
type="text"
|
|
||||||
auto-complete="off"
|
|
||||||
placeholder="账号"
|
|
||||||
>
|
|
||||||
<svg-icon
|
|
||||||
slot="prefix"
|
|
||||||
icon-class="user"
|
|
||||||
class="el-input__icon input-icon"
|
|
||||||
/>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input
|
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
||||||
v-model="loginForm.password"
|
@keyup.enter.native="handleLogin">
|
||||||
type="password"
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
auto-complete="off"
|
|
||||||
placeholder="密码"
|
|
||||||
@keyup.enter.native="handleLogin"
|
|
||||||
>
|
|
||||||
<svg-icon
|
|
||||||
slot="prefix"
|
|
||||||
icon-class="password"
|
|
||||||
class="el-input__icon input-icon"
|
|
||||||
/>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaOnOff">
|
<el-form-item prop="code" v-if="captchaOnOff">
|
||||||
<el-input
|
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 44%"
|
||||||
v-model="loginForm.code"
|
@keyup.enter.native="handleLogin">
|
||||||
auto-complete="off"
|
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||||
placeholder="验证码"
|
|
||||||
style="width: 44%"
|
|
||||||
@keyup.enter.native="handleLogin"
|
|
||||||
>
|
|
||||||
<svg-icon
|
|
||||||
slot="prefix"
|
|
||||||
icon-class="validCode"
|
|
||||||
class="el-input__icon input-icon"
|
|
||||||
/>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="login-code">
|
<div class="login-code">
|
||||||
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-checkbox
|
<el-checkbox v-model="loginForm.rememberMe" style="margin: 2px 20px 77px 122px">记住密码</el-checkbox>
|
||||||
v-model="loginForm.rememberMe"
|
|
||||||
style="margin: 2px 20px 77px 122px"
|
|
||||||
>记住密码</el-checkbox
|
|
||||||
>
|
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item style="width: 100%">
|
||||||
<el-button
|
<el-button :loading="loading" size="medium" type="primary" style="
|
||||||
:loading="loading"
|
|
||||||
size="medium"
|
|
||||||
type="primary"
|
|
||||||
style="
|
|
||||||
width: 55%;
|
width: 55%;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@ -76,16 +38,12 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
"
|
" @click.native.prevent="handleLogin">
|
||||||
@click.native.prevent="handleLogin"
|
|
||||||
>
|
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
<div style="float: right" v-if="register">
|
<div style="float: right" v-if="register">
|
||||||
<router-link class="link-type" :to="'/register'"
|
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
||||||
>立即注册</router-link
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -184,7 +142,7 @@ export default {
|
|||||||
this.$store
|
this.$store
|
||||||
.dispatch("Login", this.loginForm)
|
.dispatch("Login", this.loginForm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
|
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -200,6 +158,38 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
.toptitleimg {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
position: relative;
|
||||||
|
height: 100px;
|
||||||
|
|
||||||
|
.imgitem {
|
||||||
|
position: absolute;
|
||||||
|
left: 30%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 58px;
|
||||||
|
height: 76px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toptitle {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 40%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: inline-block;
|
||||||
|
// margin: 120px auto 58px auto;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 34px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #333333;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .el-form-item__error {
|
::v-deep .el-form-item__error {
|
||||||
color: #ff4949;
|
color: #ff4949;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@ -218,15 +208,8 @@ export default {
|
|||||||
background-image: url("../assets/images/background.png");
|
background-image: url("../assets/images/background.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
.title {
|
|
||||||
margin: 120px auto 58px auto;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 34px;
|
|
||||||
font-family: Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #333333;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-form {
|
.login-form {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
@ -241,13 +224,6 @@ export default {
|
|||||||
box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.15);
|
box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.15);
|
||||||
border-radius: 6px 6px 0px 6px;
|
border-radius: 6px 6px 0px 6px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
.imgitem {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
@ -258,31 +234,37 @@ export default {
|
|||||||
|
|
||||||
width: 474px;
|
width: 474px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border: 1px solid #e6e6e6;
|
border: 1px solid #e6e6e6;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
height: 39px;
|
height: 39px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-tip {
|
.login-tip {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-code {
|
.login-code {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-login-footer {
|
.el-login-footer {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
@ -295,6 +277,7 @@ export default {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-code-img {
|
.login-code-img {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user