2018-07-16 22:22:55 +08:00
|
|
|
<template>
|
|
|
|
|
<el-dropdown class="d2-mr">
|
2018-07-18 13:57:52 +08:00
|
|
|
<span class="btn-text">你好 {{userInfo.name}}</span>
|
2018-07-16 22:22:55 +08:00
|
|
|
<el-dropdown-menu slot="dropdown">
|
2018-07-20 09:52:09 +08:00
|
|
|
<el-dropdown-item @click.native="logOff">
|
|
|
|
|
<d2-icon name="power-off" class="d2-mr-5"/>
|
|
|
|
|
注销
|
|
|
|
|
</el-dropdown-item>
|
2018-07-16 22:22:55 +08:00
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2018-07-19 17:00:45 +08:00
|
|
|
import { mapState, mapActions } from 'vuex'
|
2018-07-16 22:22:55 +08:00
|
|
|
export default {
|
|
|
|
|
computed: {
|
2018-08-08 16:04:10 +08:00
|
|
|
...mapState('d2admin', {
|
2018-08-08 16:42:02 +08:00
|
|
|
userInfo: state => state.user.info
|
2018-08-08 16:04:10 +08:00
|
|
|
})
|
2018-07-16 22:22:55 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2018-08-08 09:19:11 +08:00
|
|
|
...mapActions('d2admin', [
|
|
|
|
|
'logout'
|
2018-07-16 22:22:55 +08:00
|
|
|
]),
|
2018-07-19 17:00:45 +08:00
|
|
|
/**
|
|
|
|
|
* @description 登出
|
|
|
|
|
*/
|
2018-07-16 22:22:55 +08:00
|
|
|
logOff () {
|
2018-08-08 09:19:11 +08:00
|
|
|
this.logout({
|
2018-07-19 17:00:45 +08:00
|
|
|
vm: this,
|
|
|
|
|
confirm: true
|
2018-07-16 22:22:55 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|