mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #194 from gradido/refactor-router
refactor: Redirects and Misuse of Children in Router
This commit is contained in:
commit
61a218b80f
@ -17,7 +17,7 @@
|
||||
</header>
|
||||
<div class="">
|
||||
<particles-bg type="custom" :config="config" :bg="true" />
|
||||
<router-view />
|
||||
<component :is="$store.state.session_id ? 'DashboardLayout' : 'AuthLayoutGDD'" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -26,11 +26,15 @@
|
||||
import { ParticlesBg } from 'particles-bg-vue'
|
||||
import icon from './icon.js'
|
||||
import { localeChanged } from 'vee-validate'
|
||||
import DashboardLayout from '@/views/Layout/DashboardLayout_gdd.vue'
|
||||
import AuthLayoutGDD from '@/views/Layout/AuthLayout_gdd.vue'
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
ParticlesBg,
|
||||
DashboardLayout,
|
||||
AuthLayoutGDD,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -1,66 +1,49 @@
|
||||
import DashboardLayout from '@/views/Layout/DashboardLayout_gdd.vue'
|
||||
import AuthLayoutGDD from '@/views/Layout/AuthLayout_gdd.vue'
|
||||
|
||||
import NotFound from '@/views/NotFoundPage.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/login',
|
||||
redirect: 'login',
|
||||
component: AuthLayoutGDD,
|
||||
children: [
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('../views/Pages/Login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/thx',
|
||||
component: () => import('../views/Pages/thx.vue'),
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: () => import('../views/Pages/Register.vue'),
|
||||
},
|
||||
{
|
||||
path: '/password',
|
||||
component: () => import('../views/Pages/Password.vue'),
|
||||
},
|
||||
{
|
||||
path: '/explorer',
|
||||
name: 'Explorer',
|
||||
component: () => import('../views/Pages/Explorer.vue'),
|
||||
},
|
||||
],
|
||||
path: '/overview',
|
||||
component: () => import('../views/KontoOverview.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/overview',
|
||||
redirect: 'overview',
|
||||
component: DashboardLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/overview',
|
||||
component: () => import('../views/KontoOverview.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/profile',
|
||||
component: () => import('../views/Pages/UserProfileCard.vue'),
|
||||
},
|
||||
{
|
||||
path: '/profileedit',
|
||||
component: () => import('../views/Pages/UserProfileEdit.vue'),
|
||||
},
|
||||
{
|
||||
path: '/activity',
|
||||
component: () => import('../views/Pages/UserProfileActivity.vue'),
|
||||
},
|
||||
{
|
||||
path: '/transactions',
|
||||
component: () => import('../views/Pages/UserProfileTransactionList.vue'),
|
||||
},
|
||||
],
|
||||
path: '/profile',
|
||||
component: () => import('../views/Pages/UserProfileCard.vue'),
|
||||
},
|
||||
{
|
||||
path: '/profileedit',
|
||||
component: () => import('../views/Pages/UserProfileEdit.vue'),
|
||||
},
|
||||
{
|
||||
path: '/activity',
|
||||
component: () => import('../views/Pages/UserProfileActivity.vue'),
|
||||
},
|
||||
{
|
||||
path: '/transactions',
|
||||
component: () => import('../views/Pages/UserProfileTransactionList.vue'),
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('../views/Pages/Login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/thx',
|
||||
component: () => import('../views/Pages/thx.vue'),
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: () => import('../views/Pages/Register.vue'),
|
||||
},
|
||||
{
|
||||
path: '/password',
|
||||
component: () => import('../views/Pages/Password.vue'),
|
||||
},
|
||||
{
|
||||
path: '/explorer',
|
||||
name: 'Explorer',
|
||||
component: () => import('../views/Pages/Explorer.vue'),
|
||||
},
|
||||
{ path: '*', component: NotFound },
|
||||
]
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<fade-transition :duration="200" mode="out-in">
|
||||
<!-- your content here -->
|
||||
<router-view></router-view>
|
||||
</fade-transition>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { FadeTransition } from 'vue2-transitions'
|
||||
export default {
|
||||
components: {
|
||||
FadeTransition,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
Loading…
x
Reference in New Issue
Block a user