登录样式

This commit is contained in:
admin
2021-06-30 17:39:36 +08:00
parent 6a503290fb
commit 321359c4c3
2 changed files with 3170 additions and 234 deletions

View File

@@ -39,13 +39,13 @@
import { mapActions } from 'vuex'
import { post } from '@/utils/http'
import bus from '@/utils/bus'
import { Loading } from 'element-ui';
import { Loading } from 'element-ui'
export default {
name: 'Login',
data () {
return {
loading:false,
loading: false,
username: 'admin',
pin: 'Nezha2021'
}
@@ -53,18 +53,21 @@ export default {
methods: {
...mapActions(['loginSuccess']),
login () {
if(!this.blockOperation.query){
this.blockOperation.query=true
if (!this.blockOperation.query) {
this.blockOperation.query = true
} else {
return
}
post('sys/login', { username: this.username, pin: this.pin }).then(
res => {
this.blockOperation.query=false
this.loading=true;
setTimeout(()=>{
this.blockOperation.query = false
this.loading = true
setTimeout(() => {
if (res.code === 200) {
localStorage.setItem('cn-username', this.username)
this.loginSuccess(res)
}},2000)
localStorage.setItem('cn-username', this.username)
this.loginSuccess(res)
}
}, 2000)
}
)
}