Refactor MainLayout.vue to improve component rendering logic
This commit is contained in:
parent
397cf28673
commit
5fffd4d2f5
@ -18,12 +18,12 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="page-container">
|
<main class="page-container">
|
||||||
<keep-alive>
|
<router-view v-slot="{ Component, route }">
|
||||||
<router-view v-slot="{ Component, route }">
|
<keep-alive v-if="route.meta.keepAlive">
|
||||||
<component :is="Component" v-if="route.meta.keepAlive" />
|
<component :is="Component" />
|
||||||
<component :is="Component" v-else :key="route.fullPath" />
|
</keep-alive>
|
||||||
</router-view>
|
<component v-else :is="Component" :key="route.fullPath" />
|
||||||
</keep-alive>
|
</router-view>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<OfflineIndicator />
|
<OfflineIndicator />
|
||||||
@ -76,7 +76,6 @@ const initializeApp = async () => {
|
|||||||
console.error('Failed to initialize app:', error);
|
console.error('Failed to initialize app:', error);
|
||||||
// Don't automatically logout - let the API interceptor handle token refresh
|
// Don't automatically logout - let the API interceptor handle token refresh
|
||||||
// The response interceptor will handle 401s and refresh tokens automatically
|
// The response interceptor will handle 401s and refresh tokens automatically
|
||||||
console.log('Token may need refresh, will be handled by API interceptor');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user