ing
This commit is contained in:
parent
eff89ec032
commit
a9eb6863f1
|
@ -1,8 +1,9 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
|
||||
import { AuthGuard } from './commons/guard/auth.guard';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', loadChildren: './pages/pages.module#PagesModule' },
|
||||
{ path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
|
||||
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
|
||||
{ path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' },
|
||||
// { path: '**', redirectTo: 'errors/404' }
|
||||
|
|
|
@ -7,6 +7,8 @@ import { HttpClientModule } from '@angular/common/http';
|
|||
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
|
||||
import { MemberModule } from 'packages/member/member.module';
|
||||
|
||||
import { RPCClient } from 'packages/core/rpc/client/RPCClient';
|
||||
import { RPCClientCodec } from 'packages/core/rpc/protocol/RPCClientCodec';
|
||||
import { RPCClientJSONCodec } from 'packages/core/rpc/protocol/json/RPCClientJSONCodec';
|
||||
|
@ -29,6 +31,7 @@ import { AppComponent } from './app.component';
|
|||
import { environment } from '../environments/environment';
|
||||
import { RPCService } from './commons/service/rpc.service';
|
||||
import { RESTService } from './commons/service/rest.service';
|
||||
import { AuthGuard } from './commons/guard/auth.guard';
|
||||
|
||||
|
||||
@NgModule({
|
||||
|
@ -41,6 +44,7 @@ import { RESTService } from './commons/service/rest.service';
|
|||
MaterialModule,
|
||||
CovalentModule,
|
||||
HttpClientModule,
|
||||
MemberModule,
|
||||
],
|
||||
providers: [
|
||||
{provide: 'REST_BASE_URL', useValue: environment.restBaseURL},
|
||||
|
@ -59,6 +63,7 @@ import { RESTService } from './commons/service/rest.service';
|
|||
provide: RPCClient, useClass: RPCService
|
||||
},
|
||||
CookieService,
|
||||
AuthGuard,
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
|
|
|
@ -58,7 +58,7 @@ export class Effects {
|
|||
signinRedirect$ = this.actions$
|
||||
.ofType(ActionType.SigninRedirect, ActionType.Signout)
|
||||
.do(authed => {
|
||||
this.router.navigate(['/login']);
|
||||
this.router.navigate(['/auth/signin']);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user