🎉 First commit, from couchbase generator, basic changes

not tested / updated yet
This commit is contained in:
Sebastián Ramírez
2019-02-09 19:42:36 +04:00
commit 7f8bfc8faa
198 changed files with 21022 additions and 0 deletions
@@ -0,0 +1,37 @@
<template>
<router-view></router-view>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { dispatchCheckLoggedIn, readIsLoggedIn } from '@/store/main/accessors';
import { store } from '@/store';
const startRouteGuard = async (to, from, next) => {
await dispatchCheckLoggedIn(store);
if (readIsLoggedIn(store)) {
if (to.path === '/login' || to.path === '/') {
next('/main');
} else {
next();
}
} else if (readIsLoggedIn(store) === false) {
if (to.path === '/' || (to.path as string).startsWith('/main')) {
next('/login');
} else {
next();
}
}
};
@Component
export default class Start extends Vue {
public beforeRouteEnter(to, from, next) {
startRouteGuard(to, from, next);
}
public beforeRouteUpdate(to, from, next) {
startRouteGuard(to, from, next);
}
}
</script>