1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/app.routing.ts

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2018-03-31 03:30:30 +08:00
import {ModuleWithProviders} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {LoginComponent} from './login/login.component';
import {GalleryComponent} from './gallery/gallery.component';
import {AdminComponent} from './admin/admin.component';
import {ShareLoginComponent} from './sharelogin/share-login.component';
2018-11-30 22:36:42 +08:00
import {QueryParams} from '../../common/QueryParams';
2016-12-27 06:36:38 +08:00
const ROUTES: Routes = [
{
path: 'login',
component: LoginComponent
},
2017-07-04 01:17:49 +08:00
{
path: 'shareLogin',
component: ShareLoginComponent
},
{
path: 'admin',
component: AdminComponent
},
{
path: 'gallery/:directory',
component: GalleryComponent
},
{
path: 'gallery',
component: GalleryComponent
},
{
path: 'search/:searchText',
component: GalleryComponent
},
2017-07-04 01:17:49 +08:00
{
2018-11-30 22:36:42 +08:00
path: 'share/:' + QueryParams.gallery.sharingKey_long,
2017-07-04 01:17:49 +08:00
component: GalleryComponent
},
2017-07-21 03:06:48 +08:00
{path: '', redirectTo: '/login', pathMatch: 'full'},
{path: '**', redirectTo: '/login', pathMatch: 'full'}
2016-12-27 06:36:38 +08:00
];
export const appRoutes: ModuleWithProviders = RouterModule.forRoot(ROUTES);