menu name added

This commit is contained in:
geek 2018-03-13 17:26:16 +09:00
parent 5028241843
commit c1a5179bfc
8 changed files with 22 additions and 2 deletions

View File

@ -3,7 +3,8 @@ import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { AuthGuard } from './commons/guard/auth.guard';
const routes: Routes = [
{ path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
// { path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
{ path: '', loadChildren: './pages/pages.module#PagesModule' },
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
{ path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' },
// { path: '**', redirectTo: 'errors/404' }

View File

@ -8,8 +8,10 @@ import {
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/take';
import 'rxjs/add/operator/map';
import { of } from 'rxjs/observable/of';
import * as AuthStore from 'packages/member/store/auth';
import { AuthSelector } from 'packages/member/store';
@ -45,6 +47,10 @@ export class AuthGuard implements CanActivate, CanActivateChild {
return true;
})
.catch(() => {
this.store.dispatch(new AuthStore.SigninRedirect(state.url));
return of(false);
})
.take(1);
}
}

View File

@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PagesComponent } from './pages.component';
import {AuthGuard} from '../commons/guard/auth.guard';
const routes: Routes = [
{

View File

@ -17,6 +17,7 @@ import { NotificationModule } from 'packages/notification/notification.module';
import {
LocalizationModule,
} from 'angular-l10n';
import {MemberModule} from '../../packages/member/member.module';
const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
suppressScrollX: true
@ -32,6 +33,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
PerfectScrollbarModule,
NotificationModule,
LocalizationModule,
MemberModule,
],
declarations: [
PagesComponent,

View File

@ -1,6 +1,6 @@
export const environment = {
production: true,
restBaseURL: 'http://127.0.0.1:19080',
restBaseURL: 'http://192.168.1.103:19080',
webappRPCConfig: {
url: 'ws://192.168.1.101:19090/webapp',
reconnectInterval: 5000,

View File

@ -0,0 +1,10 @@
import { Member } from 'packages/member/model';
export interface MemberTotp {
id?: number;
member: Member;
secretCode?: string;
createDate?: Date;
updateDate?: Date;
otpAuthUrl?: string;
}