登录样式

This commit is contained in:
admin
2021-06-30 17:32:20 +08:00
parent 0229de22d6
commit 6a503290fb

View File

@@ -4,11 +4,11 @@
<div class="title" style="margin-top:70px"> <div class="title" style="margin-top:70px">
<img src="../public/images/cion.png" /> <img src="../public/images/cion.png" />
</div> </div>
<el-form class="five"> <el-form class="login__shrink__Box">
<el-form-item> <el-form-item>
<el-input <el-input
prefix-icon="el-icon-user" prefix-icon="el-icon-user"
class="inputStyle tow" class="inputStyle login__one_input"
v-model="username" v-model="username"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@@ -22,6 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-loading="loading"
type="primary" type="primary"
class="inputStyle login__button" class="inputStyle login__button"
@click="login" @click="login"
@@ -38,11 +39,13 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { post } from '@/utils/http' import { post } from '@/utils/http'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { Loading } from 'element-ui';
export default { export default {
name: 'Login', name: 'Login',
data () { data () {
return { return {
loading:false,
username: 'admin', username: 'admin',
pin: 'Nezha2021' pin: 'Nezha2021'
} }
@@ -50,12 +53,18 @@ export default {
methods: { methods: {
...mapActions(['loginSuccess']), ...mapActions(['loginSuccess']),
login () { login () {
if(!this.blockOperation.query){
this.blockOperation.query=true
}
post('sys/login', { username: this.username, pin: this.pin }).then( post('sys/login', { username: this.username, pin: this.pin }).then(
res => { res => {
if (res.code === 200) { this.blockOperation.query=false
this.loading=true;
setTimeout(()=>{
if (res.code === 200) {
localStorage.setItem('cn-username', this.username) localStorage.setItem('cn-username', this.username)
this.loginSuccess(res) this.loginSuccess(res)
} }},2000)
} }
) )
} }
@@ -97,10 +106,10 @@ export default {
width: 300px; width: 300px;
height: 40px; height: 40px;
} }
.tow:first-of-type{ .login__one_input:first-of-type{
margin-top: 45.57px; margin-top: 45.57px;
} }
.five{ .login__shrink__Box{
width: 300px; width: 300px;
height: 250px; height: 250px;
margin: auto; margin: auto;