224 lines
5.9 KiB
TypeScript
224 lines
5.9 KiB
TypeScript
import { Route } from '@angular/router';
|
|
import { AuthGuard } from 'app/core/auth/guards/auth.guard';
|
|
import { NoAuthGuard } from 'app/core/auth/guards/noAuth.guard';
|
|
import { LayoutComponent } from 'app/layout/layout.component';
|
|
import { InitialDataResolver } from 'app/app.resolvers';
|
|
|
|
// @formatter:off
|
|
/* eslint-disable max-len */
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
export const appRoutes: Route[] = [
|
|
// Redirect empty path to '/dashboards/user'
|
|
{ path: '', pathMatch: 'full', redirectTo: 'dashboards/user' },
|
|
|
|
// Redirect signed in user to the '/dashboards/user'
|
|
//
|
|
// After the user signs in, the sign in page will redirect the user to the 'signed-in-redirect'
|
|
// path. Below is another redirection for that path to redirect the user to the desired
|
|
// location. This is a small convenience to keep all main routes together here on this file.
|
|
{
|
|
path: 'signed-in-redirect',
|
|
pathMatch: 'full',
|
|
redirectTo: 'dashboards/user',
|
|
},
|
|
|
|
// Auth routes for guests
|
|
{
|
|
path: '',
|
|
canActivate: [NoAuthGuard],
|
|
canActivateChild: [NoAuthGuard],
|
|
component: LayoutComponent,
|
|
data: {
|
|
layout: 'empty',
|
|
},
|
|
children: [
|
|
{
|
|
path: 'confirmation-required',
|
|
loadChildren: () =>
|
|
import(
|
|
'app/modules/auth/confirmation-required/confirmation-required.module'
|
|
).then((m: any) => m.AuthConfirmationRequiredModule),
|
|
},
|
|
{
|
|
path: 'forgot-password',
|
|
loadChildren: () =>
|
|
import(
|
|
'app/modules/auth/forgot-password/forgot-password.module'
|
|
).then((m: any) => m.AuthForgotPasswordModule),
|
|
},
|
|
{
|
|
path: 'reset-password',
|
|
loadChildren: () =>
|
|
import('app/modules/auth/reset-password/reset-password.module').then(
|
|
(m: any) => m.AuthResetPasswordModule
|
|
),
|
|
},
|
|
{
|
|
path: 'sign-in',
|
|
loadChildren: () =>
|
|
import('app/modules/auth/sign-in/sign-in.module').then(
|
|
(m: any) => m.AuthSignInModule
|
|
),
|
|
},
|
|
{
|
|
path: 'sign-up',
|
|
loadChildren: () =>
|
|
import('app/modules/auth/sign-up/sign-up.module').then(
|
|
(m: any) => m.AuthSignUpModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
|
|
// Auth routes for authenticated users
|
|
{
|
|
path: '',
|
|
canActivate: [AuthGuard],
|
|
canActivateChild: [AuthGuard],
|
|
component: LayoutComponent,
|
|
data: {
|
|
layout: 'empty',
|
|
},
|
|
children: [
|
|
{
|
|
path: 'sign-out',
|
|
loadChildren: () =>
|
|
import('app/modules/auth/sign-out/sign-out.module').then(
|
|
(m: any) => m.AuthSignOutModule
|
|
),
|
|
},
|
|
{
|
|
path: 'unlock-session',
|
|
loadChildren: () =>
|
|
import('app/modules/auth/unlock-session/unlock-session.module').then(
|
|
(m: any) => m.AuthUnlockSessionModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
|
|
// Landing routes
|
|
{
|
|
path: '',
|
|
component: LayoutComponent,
|
|
data: {
|
|
layout: 'empty',
|
|
},
|
|
children: [
|
|
{
|
|
path: 'home',
|
|
loadChildren: () =>
|
|
import('app/modules/landing/home/home.module').then(
|
|
(m: any) => m.LandingHomeModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
|
|
// Admin routes
|
|
{
|
|
path: '',
|
|
canActivate: [AuthGuard],
|
|
canActivateChild: [AuthGuard],
|
|
component: LayoutComponent,
|
|
resolve: {
|
|
initialData: InitialDataResolver,
|
|
},
|
|
children: [
|
|
// Dashboards
|
|
{
|
|
path: 'dashboards',
|
|
children: [
|
|
{
|
|
path: 'user',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/dashboards/user/user.module').then(
|
|
(m: any) => m.UserModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
|
|
// Apps
|
|
{
|
|
path: 'member',
|
|
children: [
|
|
{
|
|
path: 'user',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/member/user/user.module').then(
|
|
(m: any) => m.UserModule
|
|
),
|
|
},
|
|
{
|
|
path: 'casinomoney',
|
|
loadChildren: () =>
|
|
import(
|
|
'app/modules/admin/member/casinomoney/casinomoney.module'
|
|
).then((m: any) => m.CasinomoneyModule),
|
|
},
|
|
{
|
|
path: 'unconnected',
|
|
loadChildren: () =>
|
|
import(
|
|
'app/modules/admin/member/unconnected/unconnected.module'
|
|
).then((m: any) => m.UnconnectedModule),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'bank',
|
|
children: [
|
|
{
|
|
path: 'deposit',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/bank/deposit/deposit.module').then(
|
|
(m: any) => m.DepositModule
|
|
),
|
|
},
|
|
{
|
|
path: 'withdraw',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/bank/withdraw/withdraw.module').then(
|
|
(m: any) => m.WithdrawModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'game',
|
|
children: [
|
|
{
|
|
path: 'powerball',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/game/powerball/powerball.module').then(
|
|
(m: any) => m.PowerballModule
|
|
),
|
|
},
|
|
{
|
|
path: 'casino',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/game/casino/casino.module').then(
|
|
(m: any) => m.CasinoModule
|
|
),
|
|
},
|
|
{
|
|
path: 'evolution',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/game/evolution/evolution.module').then(
|
|
(m: any) => m.EvolutionModule
|
|
),
|
|
},
|
|
{
|
|
path: 'slot',
|
|
loadChildren: () =>
|
|
import('app/modules/admin/game/slot/slot.module').then(
|
|
(m: any) => m.SlotModule
|
|
),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|