Merge branch 'master' into feature/component
This commit is contained in:
commit
35647cc533
|
|
@ -1,5 +1,6 @@
|
|||
import type {NavigationGuardWithThis, RouteLocationNormalized} from 'vue-router';
|
||||
import {UserState, useUserStore} from '@/stores/user'
|
||||
import {useUserStore} from '@/stores/user'
|
||||
import type {UserState} from '@/stores/user'
|
||||
import type {Store} from 'pinia';
|
||||
|
||||
const cookieName = 'loginStatus'
|
||||
|
|
@ -31,11 +32,11 @@ const getCookieValue = (cookieName: string): string => {
|
|||
}
|
||||
|
||||
// Pina is not ready when router is called the first time by app.use(), so we need to load it here
|
||||
const getUserStore = (): UserState => {
|
||||
const getUserStore = (): UserState & Store => {
|
||||
if (!userStore) {
|
||||
userStore = useUserStore()
|
||||
}
|
||||
return userStore as unknown as UserState
|
||||
return userStore as unknown as UserState & Store
|
||||
}
|
||||
|
||||
const loginRequired = (to: RouteLocationNormalized) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue