mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
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';
|
|
import {QueryParams} from '../../common/QueryParams';
|
|
|
|
const ROUTES: Routes = [
|
|
{
|
|
path: 'login',
|
|
component: LoginComponent
|
|
},
|
|
{
|
|
path: 'shareLogin',
|
|
component: ShareLoginComponent
|
|
},
|
|
{
|
|
path: 'admin',
|
|
component: AdminComponent
|
|
},
|
|
{
|
|
path: 'gallery/:directory',
|
|
component: GalleryComponent
|
|
},
|
|
{
|
|
path: 'gallery',
|
|
component: GalleryComponent
|
|
},
|
|
{
|
|
path: 'search/:searchText',
|
|
component: GalleryComponent
|
|
},
|
|
{
|
|
path: 'share/:' + QueryParams.gallery.sharingKey_long,
|
|
component: GalleryComponent
|
|
},
|
|
{path: '', redirectTo: '/login', pathMatch: 'full'},
|
|
{path: '**', redirectTo: '/login', pathMatch: 'full'}
|
|
];
|
|
|
|
export const appRoutes: ModuleWithProviders = RouterModule.forRoot(ROUTES);
|
|
|