方法#
打開 Web 項目的 Menus\?MenuContributor
,加入以下代碼:
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
..
if (context.Menu.Name == StandardMenus.User)
{
await ConfigureUserMenuAsync(context);
}
}
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
{
context.Menu.Items.Insert(
1,
new ApplicationMenuItem(
?Menus.Subscription,
"購買套餐",
url: "/Account/Subscription",
icon: "fas fa-home",
order: 1001 // 因為“我的帳號”序號是1000
).RequirePermissions(?Permissions.?.PersonalCenter.SubscriptionPage.Default)
);
return Task.CompletedTask;
}
參考#
https://abp.io/docs/latest/framework/ui/mvc-razor-pages/navigation-menu#standard-menus