Browse Source

Merge pull request #178 from abpframework/gterdem/account_link_fix

Manage account link fix
pull/183/head
Galip Tolga Erdem 3 years ago
committed by GitHub
parent
commit
b3c26cf1e2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      apps/angular/src/app/app.module.ts
  2. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/Menus/EShopOnAbpPublicWebMenuContributor.cs

20
apps/angular/src/app/app.module.ts

@ -1,5 +1,5 @@
import { AccountConfigModule } from '@abp/ng.account/config';
import { CoreModule } from '@abp/ng.core';
import { CoreModule, EnvironmentService, NAVIGATE_TO_MANAGE_PROFILE } from '@abp/ng.core';
import { registerLocale } from '@abp/ng.core/locale';
import { IdentityConfigModule } from '@abp/ng.identity/config';
import { SettingManagementConfigModule } from '@abp/ng.setting-management/config';
@ -8,7 +8,7 @@ import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core';
import { NgModule, inject } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CatalogConfigModule } from '@eshoponabp/catalog/config';
@ -18,6 +18,7 @@ import { AppComponent } from './app.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { OrderingConfigModule } from '@eshoponabp/ordering/config';
import { AbpOAuthModule } from '@abp/ng.oauth';
@NgModule({
imports: [
BrowserModule,
@ -37,10 +38,21 @@ import { AbpOAuthModule } from '@abp/ng.oauth';
SideMenuLayoutModule.forRoot(),
AccountLayoutModule.forRoot(),
CatalogConfigModule.forRoot(),
OrderingConfigModule.forRoot()
OrderingConfigModule.forRoot(),
],
declarations: [AppComponent],
providers: [APP_ROUTE_PROVIDER],
providers: [
APP_ROUTE_PROVIDER,
{
provide: NAVIGATE_TO_MANAGE_PROFILE,
useFactory: () => {
const environment = inject(EnvironmentService);
return () => {
location.href = `${environment.getIssuer()}account`;
};
},
},
],
bootstrap: [AppComponent],
})
export class AppModule {}

2
apps/public-web/src/EShopOnAbp.PublicWeb/Menus/EShopOnAbpPublicWebMenuContributor.cs

@ -55,7 +55,7 @@ namespace EShopOnAbp.PublicWeb.Menus
var accountResource = context.GetLocalizer<AccountResource>();
var eShopResource = context.GetLocalizer<EShopOnAbpResource>();
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountResource["MyAccount"], $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage", icon: "fa fa-cog", order: 1000, null, "_blank").RequireAuthenticated());
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountResource["MyAccount"], $"{identityServerUrl.EnsureEndsWith('/')}account", icon: "fa fa-cog", order: 1000, null, "_blank").RequireAuthenticated());
context.Menu.AddItem(new ApplicationMenuItem("MyOrders", eShopResource["Menu:MyOrders"], $"/MyOrders", icon: "fa fa-shopping-cart", order: 2, null).RequireAuthenticated());
context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", uiResource["Logout"], url: "~/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000).RequireAuthenticated());

Loading…
Cancel
Save