734b2c91f9
1. 将Hua.Cli.Tests、项目共享库、模块项目等所有项目的TargetFramework从net8.0/net9.0升级到net10.0 2. 完善dotnet-tools.json、模板配置文件,添加必要的构建和发布配置 3. 新增微服务、网关、应用程序的启动脚本和基础配置文件 4. 补充产品管理模块的领域、应用、Web层基础代码和多语言资源
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp.UI.Navigation;
|
|
using Volo.Abp.Users;
|
|
|
|
namespace Company.Project.BackendAdminApp;
|
|
|
|
public class BackendAdminAppMenuContributor : IMenuContributor
|
|
{
|
|
private readonly IConfiguration _configuration;
|
|
|
|
public BackendAdminAppMenuContributor(IConfiguration configuration)
|
|
{
|
|
_configuration = configuration;
|
|
}
|
|
|
|
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
|
|
{
|
|
if (context.Menu.Name == StandardMenus.User)
|
|
{
|
|
await ConfigureUserMenuAsync(context);
|
|
}
|
|
}
|
|
|
|
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
|
|
{
|
|
var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>();
|
|
var identityServerUrl = _configuration["AuthServer:Authority"] ?? "";
|
|
|
|
if (currentUser.IsAuthenticated)
|
|
{
|
|
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", "Manage Your Profile", $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage", icon: "fa fa-cog", order: 1000, null, "_blank"));
|
|
context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", "Logout", url: "/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000));
|
|
}
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|