fix user login page display
This commit is contained in:
parent
de52c5e6be
commit
009752ff32
3 changed files with 15 additions and 8 deletions
|
|
@ -17,12 +17,12 @@ router.beforeEach(async (to, from, next) => {
|
|||
|
||||
if (to.path === '/login') next();
|
||||
|
||||
if (!userStore.user) next('/login');
|
||||
|
||||
const api = useApiStore(pinia);
|
||||
try {
|
||||
const res = await api.fetchData(to.path);
|
||||
|
||||
if (!res.user) next('/login');
|
||||
|
||||
pageStore.page = res.page;
|
||||
userStore.user = res.user;
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue