mod: 细节调整
This commit is contained in:
parent
ae43ffb94f
commit
ef33b28492
@ -1,17 +1,18 @@
|
||||
<template>
|
||||
<n-breadcrumb>
|
||||
<n-breadcrumb-item v-for="item in currentRoute.matched" :key="item.path" @click="handleBreadClick(item.path)">
|
||||
<n-breadcrumb-item v-for="item in route.matched" :key="item.path" @click="handleBreadClick(item.path)">
|
||||
{{ item.meta.title }}
|
||||
</n-breadcrumb-item>
|
||||
</n-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { router } from '@/router'
|
||||
const { currentRoute } = router
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
function handleBreadClick(path) {
|
||||
if (path === currentRoute.value.path) return
|
||||
if (path === route.path) return
|
||||
router.push(path)
|
||||
}
|
||||
</script>
|
||||
|
@ -38,10 +38,10 @@ export const useUserStore = defineStore('user', {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
toLogin()
|
||||
async logout() {
|
||||
removeToken()
|
||||
this.userInfo = {}
|
||||
toLogin()
|
||||
},
|
||||
setUserInfo(userInfo = {}) {
|
||||
this.userInfo = { ...this.userInfo, ...userInfo }
|
||||
|
Loading…
Reference in New Issue
Block a user