mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-02 21:18:13 +00:00
26 lines
438 B
TypeScript
26 lines
438 B
TypeScript
import { createApp } from 'vue';
|
|
|
|
import App from './App.vue';
|
|
import router from './router';
|
|
|
|
import { createPinia } from 'pinia';
|
|
import { useStore } from './store';
|
|
|
|
const pinia = createPinia();
|
|
const app = createApp(App);
|
|
|
|
app.use(pinia).use(router);
|
|
app.mount('#app');
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
const store = useStore();
|
|
|
|
if (to.meta.protected && !store.user) {
|
|
next('/login');
|
|
return;
|
|
}
|
|
|
|
next();
|
|
});
|
|
|