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