Merge pull request #151 from yale8848/vue3.0-antdv

This commit is contained in:
good luck 2021-09-01 14:32:36 +08:00 committed by GitHub
commit 2014f6ad37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,20 +22,23 @@
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { computed } from 'vue' import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
export default { export default {
name: 'VabAvatar', name: 'VabAvatar',
components: { DownOutlined }, components: { DownOutlined },
setup() { setup() {
const store = useStore() const store = useStore()
const router = useRouter();
const route = useRoute();
const logout = async () => { const logout = async () => {
await this.$store.dispatch('user/logout') await store.dispatch('user/logout')
if (recordRoute) { if (recordRoute) {
const fullPath = this.$route.fullPath const fullPath = route.fullPath
this.$router.push(`/login?redirect=${fullPath}`) router.push(`/login?redirect=${fullPath}`)
} else { } else {
this.$router.push('/login') router.push('/login')
} }
} }