mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-25 02:40:15 +08:00
Merge pull request #151 from yale8848/vue3.0-antdv
This commit is contained in:
commit
2014f6ad37
@ -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')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user