Redirect / to /home in the router
This commit is contained in:
+3
-2
@@ -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>
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user