Skip to content

Commit

Permalink
editor bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
digger committed Sep 8, 2020
1 parent fcedeae commit 8fdb981
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 107 deletions.
209 changes: 103 additions & 106 deletions ui/src/view/login/login.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,110 @@

<template>
<div style="text-align: center;" class="loginPage">
<div class="container" id="container">
<div class="form-container sign-in-container">
<form action="#" type="button">
<h1>登录</h1>
<input type="text" v-model="username" placeholder="用户名">
<input type="password" v-model="password" placeholder="密码">
<p style="width: 100%; font-size: 12px; color: #c3c3c3; margin: 5px 0">默认用户名密码:admin/admin</p>
<button type="button" @click="handleSubmit">登录</button>
</form>
</div>
<div class="overlay-container">
<div class="overlay">
<div class="overlay-panel overlay-right">
<img src="">
<h1>Digger</h1>
<p>A powerful and flexible web crawler</p>
</div>
</div>
</div>
</div>
</div>
</template>

<script>
import LoginForm from '_c/login-form'
import { mapActions } from 'vuex'
export default {
components: {
LoginForm
},
data() {
return {
username: '',
password: '',
}
},
methods: {
...mapActions([
'handleLogin',
'getUserInfo'
]),
handleSubmit () {
if (this.username.trim() == '') {
this.$Message.error('请输入用户名')
return
}
if (this.password.trim() == '') {
this.$Message.error('请输入密码')
return
}
this.handleLogin({
username: this.username,
password: this.password
}).then(res => {
this.getUserInfo().then(res => {
this.$router.push({
name: this.$config.homeName
})
})
})
}
}
}
</script>

<style>
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
* {
.loginPage * {
box-sizing: border-box;
}
h1 {
.loginPage h1 {
font-weight: bold;
margin: 0;
}
h2 {
.loginPage h2 {
text-align: center;
}
p {
.loginPage p {
font-size: 14px;
font-weight: 100;
line-height: 20px;
letter-spacing: 0.5px;
margin: 20px 0 30px;
/*margin: 20px 0 30px;*/
}
span {
.loginPage span {
font-size: 12px;
}
a {
.loginPage a {
color: #333;
font-size: 14px;
/* text-decoration: none; */
margin: 15px 0;
}
button {
.loginPage button {
border-radius: 20px;
border: 1px solid #2D8CF0;
background-color: #2D8CF0;
Expand All @@ -47,20 +117,20 @@
transition: transform 80ms ease-in;
}
button:active {
.loginPage button:active {
transform: scale(0.95);
}
button:focus {
.loginPage button:focus {
outline: none;
}
button.ghost {
.loginPage button.ghost {
background-color: transparent;
border-color: #FFFFFF;
}
form {
.loginPage form {
background-color: #FFFFFF;
display: flex;
align-items: center;
Expand All @@ -71,15 +141,15 @@
text-align: center;
}
input {
.loginPage input {
background-color: #eee;
border: none;
padding: 12px 15px;
margin: 8px 0;
width: 100%;
}
.container {
.loginPage .container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 14px 28px rgba(0,0,0,0.25),
Expand All @@ -94,31 +164,31 @@
margin-top: 10%;
}
.form-container {
.loginPage .form-container {
position: absolute;
top: 0;
height: 100%;
transition: all 0.6s ease-in-out;
}
.sign-in-container {
.loginPage .sign-in-container {
left: 0;
width: 50%;
z-index: 2;
}
.container.right-panel-active .sign-in-container {
.loginPage .container.right-panel-active .sign-in-container {
transform: translateX(100%);
}
.sign-up-container {
.loginPage .sign-up-container {
left: 0;
width: 50%;
opacity: 0;
z-index: 1;
}
.container.right-panel-active .sign-up-container {
.loginPage .container.right-panel-active .sign-up-container {
transform: translateX(100%);
opacity: 1;
z-index: 5;
Expand All @@ -137,7 +207,7 @@
}
}
.overlay-container {
.loginPage .overlay-container {
position: absolute;
top: 0;
left: 50%;
Expand All @@ -148,11 +218,11 @@
z-index: 100;
}
.container.right-panel-active .overlay-container{
.loginPage .container.right-panel-active .overlay-container{
transform: translateX(-100%);
}
.overlay {
.loginPage .overlay {
background: #2D8CF0;
background: -webkit-linear-gradient(to right, #2DF0EE, #2D8CF0);
background: linear-gradient(to right, #2DF0EE, #2D8CF0);
Expand All @@ -168,11 +238,11 @@
transition: transform 0.6s ease-in-out;
}
.container.right-panel-active .overlay {
.loginPage .container.right-panel-active .overlay {
transform: translateX(50%);
}
.overlay-panel {
.loginPage .overlay-panel {
position: absolute;
display: flex;
align-items: center;
Expand All @@ -187,15 +257,15 @@
transition: transform 0.6s ease-in-out;
}
.overlay-left {
.loginPage .overlay-left {
transform: translateX(-20%);
}
.container.right-panel-active .overlay-left {
.loginPage .container.right-panel-active .overlay-left {
transform: translateX(0);
}
.overlay-right {
.loginPage .overlay-right {
right: 0;
transform: translateX(0);
}
Expand All @@ -204,11 +274,11 @@
transform: translateX(20%);
}
.social-container {
.loginPage .social-container {
margin: 20px 0;
}
.social-container a {
.loginPage .social-container a {
border: 1px solid #DDDDDD;
border-radius: 50%;
display: inline-flex;
Expand All @@ -219,7 +289,7 @@
width: 40px;
}
footer {
.loginPage footer {
background-color: #222;
color: #fff;
font-size: 14px;
Expand All @@ -231,89 +301,16 @@
z-index: 999;
}
footer p {
.loginPage footer p {
margin: 10px 0;
}
footer i {
.loginPage footer i {
color: red;
}
footer a {
.loginPage footer a {
color: #3c97bf;
text-decoration: none;
}
</style>

<template>
<div style="text-align: center;">
<div class="container" id="container">
<div class="form-container sign-in-container">
<form action="#" type="button">
<h1>登录</h1>
<input type="text" v-model="username" placeholder="用户名">
<input type="password" v-model="password" placeholder="密码">
<p style="width: 100%; font-size: 12px; color: #c3c3c3; margin: 5px 0">默认用户名密码:admin/admin</p>
<button type="button" @click="handleSubmit">登录</button>
</form>
</div>
<div class="overlay-container">
<div class="overlay">
<div class="overlay-panel overlay-right">
<img src="">
<h1>Digger</h1>
<p>A powerful and flexible web crawler</p>
</div>
</div>
</div>
</div>
</div>
</template>

<script>
import LoginForm from '_c/login-form'
import { mapActions } from 'vuex'
export default {
components: {
LoginForm
},
data() {
return {
username: '',
password: '',
}
},
methods: {
...mapActions([
'handleLogin',
'getUserInfo'
]),
handleSubmit () {
if (this.username.trim() == '') {
this.$Message.error('请输入用户名')
return
}
if (this.password.trim() == '') {
this.$Message.error('请输入密码')
return
}
this.handleLogin({
username: this.username,
password: this.password
}).then(res => {
this.getUserInfo().then(res => {
this.$router.push({
name: this.$config.homeName
})
})
})
}
}
}
</script>

<style>
</style>

0 comments on commit 8fdb981

Please sign in to comment.