Redirect / to /home in the router

This commit is contained in:
Johannes Zellner
2023-02-28 17:11:54 +01:00
parent 4f8f944282
commit 359396b2c7
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -1,9 +1,10 @@
<template>
<router-view v-slot="{ Component }">
<!-- <router-view v-slot="{ Component }">
<transition name="fade">
<component :is="Component" />
</transition>
</router-view>
</router-view> -->
<router-view></router-view>
</template>
<script>
+1
View File
@@ -15,6 +15,7 @@ import Home from './views/Home.vue';
import Viewer from './views/Viewer.vue';
const routes = [
{ path: '/', redirect: '/home' },
{ path: '/home/:appId?/:currentPath*', component: Home },
{ path: '/viewer/:appId/:filePath*', component: Viewer },
{ path: '/login', component: Login },
+2 -3
View File
@@ -138,7 +138,7 @@ export default {
},
async loadApp(appId) {
this.activeApp = this.apps.find(a => a.id === appId);
if (!this.activeApp) return console.log('Unable to find app', appId);
if (!this.activeApp) return console.error('Unable to find app', appId);
this.directoryModel = createDirectoryModel(BASE_URL, localStorage.accessToken, appId);
this.loadCurrentPath();
@@ -157,12 +157,11 @@ export default {
const appId = this.$route.params.appId || 'e78a515c-2153-48a6-aa62-badd6a540d4e';
this.activeApp = this.apps.find(a => a.id === appId);
if (!this.activeApp) return console.log('Unable to find app', appId);
if (!this.activeApp) return console.error('Unable to find app', appId);
this.selectedAppId = this.activeApp.id;
this.currentPath = sanitize('/' + (this.$route.params.currentPath ? this.$route.params.currentPath.join('/') : '/'));
console.log(appId, this.activeApp, this.currentPath)
this.loadApp(this.activeApp.id);