diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1eb0b93..3591bec 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -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' } diff --git a/src/app/commons/guard/auth.guard.ts b/src/app/commons/guard/auth.guard.ts index 4334e97..23e4d3a 100644 --- a/src/app/commons/guard/auth.guard.ts +++ b/src/app/commons/guard/auth.guard.ts @@ -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); } } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index 2cc5e98..6182187 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -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 = [ { diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index f95f1da..d2afbba 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -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, diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index fdadde5..0d3b84a 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -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, diff --git a/src/packages/settings/member/model/MemberTotp.ts b/src/packages/settings/member/model/MemberTotp.ts new file mode 100644 index 0000000..820590a --- /dev/null +++ b/src/packages/settings/member/model/MemberTotp.ts @@ -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; +} diff --git a/src/packages/settings/member/model/index.ts b/src/packages/settings/member/model/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/settings/member/service/index.ts b/src/packages/settings/member/service/index.ts new file mode 100644 index 0000000..e69de29