feat: add login blocking; 🌟

新增:登录拦截功能;
This commit is contained in:
chenghongxing
2020-07-20 22:39:46 +08:00
parent d21a2ab062
commit 4e6a060dfe
7 changed files with 79 additions and 12 deletions

View File

@@ -15,10 +15,10 @@
</a-menu-item>
<a-menu-divider />
<a-menu-item>
<router-link to="/login">
<a @click="logout">
<a-icon type="poweroff" />
<span>退出登录</span>
</router-link>
</a>
</a-menu-item>
</a-menu>
</a-dropdown>
@@ -26,12 +26,18 @@
<script>
import {mapState} from 'vuex'
import {logout} from '@/services'
export default {
name: 'HeaderAvatar',
computed: {
...mapState('setting', ['weekMode']),
...mapState('account', ['user']),
},
methods: {
logout() {
logout()
this.$router.push('/login')
}
}
}
</script>