This commit is contained in:
chenjinsong
2021-06-11 10:00:22 +08:00
parent 13329e8f85
commit bc54fc58fd
31 changed files with 2819 additions and 92 deletions

View File

@@ -1,10 +1,36 @@
<template>
<div></div>
<div>
<el-input v-model="username"></el-input>
<el-input v-model="pin"></el-input>
<button type="button" @click="login">Login</button>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { post } from '@/utils/http'
import bus from '@/utils/bus'
export default {
name: 'Login'
name: 'Login',
data () {
return {
username: 'admin',
pin: 'Nezha2021'
}
},
methods: {
...mapActions(['loginSuccess']),
login () {
post('sys/login', { username: this.username, pin: this.pin }).then(res => {
if (res.code === 200) {
this.loginSuccess(res)
}
})
}
},
mounted () {
}
}
</script>