init commit

This commit is contained in:
zhouyuejun
2018-10-26 11:33:25 +08:00
commit bec3bb9137
106 changed files with 29628 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
import { NgModule } from '@angular/core';
/* 引入路由模块 */
import { RouterModule, Routes } from '@angular/router';
/* 引入预加载策略 */
import { SelectivePreloadingStrategy } from './preloading-strategy';
/* 引入路由权限控制 */
import {LoginAuthService} from './services/login-auth.service'
/* 定义路由 */
const appRoutes: Routes = [
{ path: '', redirectTo: '/login', pathMatch: 'full' },
{
path: 'login',
loadChildren: './login/login.module#LoginModule',
canActivate:[LoginAuthService],
},
{
path: 'register',
loadChildren: './register/register.module#RegisterModule',
// data: { preload: false }
},
{
path: 'app',
loadChildren: './pages/pages.module#PagesModule',
canActivate:[LoginAuthService],
data: { preload: false }
}
]
@NgModule({
imports: [RouterModule.forRoot(appRoutes, { preloadingStrategy: SelectivePreloadingStrategy, useHash: true })],
exports: [
RouterModule
]
})
export class AppRoutingModule { }