mod: 细节调整

This commit is contained in:
张传龙 2022-06-17 23:05:57 +08:00
parent ae43ffb94f
commit ef33b28492
2 changed files with 7 additions and 6 deletions

View File

@ -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>

View File

@ -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 }