[web-app] ng-alain模版工程初始化
This commit is contained in:
66
web-app/src/app/routes/routes-routing.module.ts
Normal file
66
web-app/src/app/routes/routes-routing.module.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { SimpleGuard } from '@delon/auth';
|
||||
import { environment } from '@env/environment';
|
||||
// layout
|
||||
import { LayoutBasicComponent } from '../layout/basic/basic.component';
|
||||
import { LayoutPassportComponent } from '../layout/passport/passport.component';
|
||||
// dashboard pages
|
||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
// single pages
|
||||
import { CallbackComponent } from './passport/callback.component';
|
||||
import { UserLockComponent } from './passport/lock/lock.component';
|
||||
// passport pages
|
||||
import { UserLoginComponent } from './passport/login/login.component';
|
||||
import { UserRegisterResultComponent } from './passport/register-result/register-result.component';
|
||||
import { UserRegisterComponent } from './passport/register/register.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LayoutBasicComponent,
|
||||
canActivate: [SimpleGuard],
|
||||
children: [
|
||||
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
|
||||
{ path: 'dashboard', component: DashboardComponent, data: { title: '仪表盘' } },
|
||||
{ path: 'exception', loadChildren: () => import('./exception/exception.module').then(m => m.ExceptionModule) },
|
||||
// 业务子模块
|
||||
// { path: 'widgets', loadChildren: () => import('./widgets/widgets.module').then(m => m.WidgetsModule) },
|
||||
]
|
||||
},
|
||||
// 空白布局
|
||||
// {
|
||||
// path: 'blank',
|
||||
// component: LayoutBlankComponent,
|
||||
// children: [
|
||||
// ]
|
||||
// },
|
||||
// passport
|
||||
{
|
||||
path: 'passport',
|
||||
component: LayoutPassportComponent,
|
||||
children: [
|
||||
{ path: 'login', component: UserLoginComponent, data: { title: '登录' } },
|
||||
{ path: 'register', component: UserRegisterComponent, data: { title: '注册' } },
|
||||
{ path: 'register-result', component: UserRegisterResultComponent, data: { title: '注册结果' } },
|
||||
{ path: 'lock', component: UserLockComponent, data: { title: '锁屏' } },
|
||||
]
|
||||
},
|
||||
// 单页不包裹Layout
|
||||
{ path: 'passport/callback/:type', component: CallbackComponent },
|
||||
{ path: '**', redirectTo: 'exception/404' },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
routes, {
|
||||
useHash: environment.useHash,
|
||||
// NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled`
|
||||
// Pls refer to https://ng-alain.com/components/reuse-tab
|
||||
scrollPositionRestoration: 'top',
|
||||
}
|
||||
)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class RouteRoutingModule { }
|
||||
Reference in New Issue
Block a user