feat:添加个人中心

This commit is contained in:
橙子
2023-03-19 00:42:18 +08:00
parent c613b185da
commit 10fef4e2d9
62 changed files with 1430 additions and 129 deletions

View File

@@ -24,6 +24,7 @@ namespace Yi.RBAC.Application.Identity
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.MenuName), x => x.MenuName.Contains(input.MenuName!))
.WhereIF(input.State is not null, x => x.State == input.State)
.OrderByDescending(x=>x.OrderNum)
.ToPageListAsync(input.PageNum, input.PageSize, total);
return new PagedResultDto<MenuGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}

View File

@@ -17,6 +17,10 @@ namespace Yi.RBAC.Domain.DataSeeds
{
}
public override async Task<bool> IsInvoker()
{
return !await _repository.IsAnyAsync(x => x.MenuName == "系统管理");
}
public override List<MenuEntity> GetSeedData()
{
List<MenuEntity> entities = new List<MenuEntity>();
@@ -107,88 +111,6 @@ namespace Yi.RBAC.Domain.DataSeeds
entities.Add(swagger);
//BBS
MenuEntity bbs = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "BBS",
MenuType = MenuTypeEnum.Catalogue,
Router = "/bbs",
IsShow = true,
IsLink = false,
MenuIcon = "international",
OrderNum = 97,
ParentId = 0,
IsDeleted = false
};
entities.Add(bbs);
//文章管理
MenuEntity article = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "文章管理",
PermissionCode = "bbs:article:list",
MenuType = MenuTypeEnum.Menu,
Router = "article",
IsShow = true,
IsLink = false,
IsCache = true,
Component = "bbs/article/index",
MenuIcon = "education",
OrderNum = 100,
ParentId = bbs.Id,
IsDeleted = false
};
entities.Add(article);
MenuEntity articleQuery = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "文章查询",
PermissionCode = "bbs:article:query",
MenuType = MenuTypeEnum.Component,
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
entities.Add(articleQuery);
MenuEntity articleAdd = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "文章新增",
PermissionCode = "bbs:article:add",
MenuType = MenuTypeEnum.Component,
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
entities.Add(articleAdd);
MenuEntity articleEdit = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "文章修改",
PermissionCode = "bbs:article:edit",
MenuType = MenuTypeEnum.Component,
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
entities.Add(articleEdit);
MenuEntity articleRemove = new MenuEntity()
{
Id = SnowflakeHelper.NextId,
MenuName = "文章删除",
PermissionCode = "bbs:article:remove",
MenuType = MenuTypeEnum.Component,
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
entities.Add(articleRemove);
//ERP
MenuEntity erp = new MenuEntity()
{
@@ -1143,6 +1065,13 @@ namespace Yi.RBAC.Domain.DataSeeds
IsDeleted = false
};
entities.Add(loginLogRemove);
//默认值
entities.ForEach(m =>
{
m.IsDeleted = false;
m.State = true;
});
return entities;
}
}