mirror of
https://github.com/valitydev/koffing.git
synced 2024-11-06 09:15:20 +00:00
FE-184: Интегрировать управление учеткой keycloak в ЛК (#86)
* FE-184: Интегрировать управление учеткой keycloak в ЛК
This commit is contained in:
parent
fa175e8f70
commit
388a04b872
18
src/app/account/account-routing.module.ts
Normal file
18
src/app/account/account-routing.module.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { AccountComponent } from 'koffing/account/components/account.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: 'account',
|
||||
component: AccountComponent
|
||||
}
|
||||
])
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
]
|
||||
})
|
||||
export class AccountRoutingModule {}
|
20
src/app/account/account.module.ts
Normal file
20
src/app/account/account.module.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AccountComponent } from 'koffing/account/components/account.component';
|
||||
import { AccountRoutingModule } from 'koffing/account/account-routing.module';
|
||||
import { CommonModule } from 'koffing/common/common.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
AccountRoutingModule,
|
||||
BrowserModule
|
||||
],
|
||||
declarations: [
|
||||
AccountComponent
|
||||
]
|
||||
})
|
||||
export class AccountModule { }
|
||||
|
||||
export * from './components/account.component';
|
4
src/app/account/components/account.component.less
Normal file
4
src/app/account/components/account.component.less
Normal file
@ -0,0 +1,4 @@
|
||||
iframe.account-frame {
|
||||
width: 100%;
|
||||
min-height: 800px;
|
||||
}
|
1
src/app/account/components/account.component.pug
Normal file
1
src/app/account/components/account.component.pug
Normal file
@ -0,0 +1 @@
|
||||
iframe.account-frame(frameborder="0", scrolling="no", [src]="accountFrameUrl")
|
25
src/app/account/components/account.component.ts
Normal file
25
src/app/account/components/account.component.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||
|
||||
import { AuthService } from 'koffing/auth/auth.module';
|
||||
|
||||
@Component({
|
||||
selector: 'kof-account',
|
||||
templateUrl: 'account.component.pug',
|
||||
styleUrls: ['./account.component.less']
|
||||
})
|
||||
export class AccountComponent implements OnInit {
|
||||
|
||||
public accountFrameUrl: SafeResourceUrl;
|
||||
|
||||
constructor(
|
||||
private sanitizer: DomSanitizer
|
||||
) { }
|
||||
|
||||
public ngOnInit() {
|
||||
const keycloakUrl = AuthService.getAccountInfo().authUrl;
|
||||
const accountFrameUrl = `${keycloakUrl}realms/external/account/`;
|
||||
this.accountFrameUrl = this.sanitizer.bypassSecurityTrustResourceUrl(accountFrameUrl);
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
export class AuthInfo {
|
||||
|
||||
public profileName: string = '';
|
||||
|
||||
public token: string = '';
|
||||
|
||||
public authUrl: string = '';
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ export class AuthService {
|
||||
if (this.koffingInstance) {
|
||||
result.profileName = this.koffingInstance.tokenParsed.name;
|
||||
result.token = this.koffingInstance.token;
|
||||
result.authUrl = this.koffingInstance.authServerUrl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -26,4 +26,8 @@
|
||||
li
|
||||
a(href="https://rbkmoney.github.io/api", target="_blank")
|
||||
i.fa.fa-share-alt
|
||||
| API
|
||||
| API
|
||||
li([routerLinkActive]="['active']")
|
||||
a([routerLink]=["/account"])
|
||||
i.fa.fa-user
|
||||
| Мои данные
|
||||
|
@ -11,6 +11,7 @@ import { SidebarComponent } from './components/sidebar/sidebar.component';
|
||||
import { TopPanelComponent } from './components/top-panel/top-panel.component';
|
||||
import { ContainerComponent } from './components/container/container.component';
|
||||
import { HttpErrorHandleComponent } from './components/http-error-handle/http-error-handle.component';
|
||||
import { AccountModule } from 'koffing/account/account.module';
|
||||
import { NotificationHandleComponent } from './components/notification-handle/notification-handle.component';
|
||||
|
||||
@NgModule({
|
||||
@ -21,7 +22,8 @@ import { NotificationHandleComponent } from './components/notification-handle/no
|
||||
BroadcasterModule,
|
||||
TokenizationModule,
|
||||
AnalyticsModule,
|
||||
ManagementModule
|
||||
ManagementModule,
|
||||
AccountModule
|
||||
],
|
||||
declarations: [
|
||||
ContainerComponent,
|
||||
|
Loading…
Reference in New Issue
Block a user