init
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user