Browse Source

redirect to account module for manage profile page

pull/7861/head
mehmet-erim 6 years ago
parent
commit
5968d97f2d
  1. 20
      npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts

20
npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts

@ -1,6 +1,5 @@
import { AuthService, ConfigStateService, CurrentUserDto, EnvironmentService } from '@abp/ng.core'; import { AuthService, ConfigStateService, CurrentUserDto } from '@abp/ng.core';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
@Component({ @Component({
@ -36,7 +35,7 @@ import { Observable } from 'rxjs';
aria-labelledby="dropdownMenuLink" aria-labelledby="dropdownMenuLink"
[class.d-block]="smallScreen && currentUserDropdown.isOpen()" [class.d-block]="smallScreen && currentUserDropdown.isOpen()"
> >
<a class="dropdown-item" [href]="manageProfileUrl" <a class="dropdown-item" routerLink="/account/manage-profile"
><i class="fa fa-cog mr-1"></i>{{ 'AbpAccount::ManageYourProfile' | abpLocalization }}</a ><i class="fa fa-cog mr-1"></i>{{ 'AbpAccount::ManageYourProfile' | abpLocalization }}</a
> >
<a class="dropdown-item" href="javascript:void(0)" (click)="logout()" <a class="dropdown-item" href="javascript:void(0)" (click)="logout()"
@ -53,24 +52,13 @@ export class CurrentUserComponent {
return window.innerWidth < 992; return window.innerWidth < 992;
} }
get manageProfileUrl() { constructor(private authService: AuthService, private configState: ConfigStateService) {}
return `${this.environment.getEnvironment().oAuthConfig.issuer}/Account/Manage?returnUrl=${
window.location.href
}`;
}
constructor(
private authService: AuthService,
private router: Router,
private configState: ConfigStateService,
private environment: EnvironmentService,
) {}
initLogin() { initLogin() {
this.authService.initLogin(); this.authService.initLogin();
} }
logout() { logout() {
this.authService.logout().subscribe(); this.authService.logout().subscribe();
} }
} }

Loading…
Cancel
Save