loulijun2021
2022-06-26 0d86c19b122011dc528c624597b0952660d69aba
src/layout/components/Navbar.vue
@@ -44,7 +44,9 @@
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
import { getCookie } from '@/utils/auth'
import { getCookie, removeCookie, removeToken } from '@/utils/auth'
import { logout } from '@/api/user'
import { resetRouter } from '@/router'
export default {
  components: {
@@ -71,7 +73,8 @@
    },
    async logout() {
      await this.$store.dispatch('user/logout')
      this.$router.push(`/login?redirect=${this.$route.fullPath}`)
      this.$message.success('退出成功!')
      this.$router.push(`/login`)
    }
  }
}