feat: 引入路由拦截
This commit is contained in:
@@ -13,16 +13,19 @@ export const useUserStore = defineStore(
|
||||
}
|
||||
|
||||
const clearUserInfo = () => {
|
||||
userInfo.value = undefined
|
||||
userInfo.value = { ...initState }
|
||||
}
|
||||
// 一般没有reset需求,不需要的可以删除
|
||||
const reset = () => {
|
||||
userInfo.value = { ...initState }
|
||||
}
|
||||
const isLogined = computed(() => !!userInfo.value.token)
|
||||
|
||||
return {
|
||||
userInfo,
|
||||
setUserInfo,
|
||||
clearUserInfo,
|
||||
isLogined,
|
||||
reset,
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user