修复路由切换问题

This commit is contained in:
陈淳
2022-10-29 10:33:08 +08:00
parent c901b4bc06
commit d6fd02ec19
9 changed files with 854 additions and 278 deletions

View File

@@ -13,7 +13,7 @@ namespace Yi.Framework.Model.Models
public partial class MenuEntity
{
[SqlSugar.SugarColumn(IsIgnore = true)]
public List<MenuEntity> Children { get; set; }
public List<MenuEntity>? Children { get; set; }
public static List<VueRouterModel> RouterBuild(List<MenuEntity> menus)

View File

@@ -37,7 +37,7 @@ namespace Yi.Framework.Model.Models
/// 操作人员
///</summary>
[SugarColumn(ColumnName="OperUser" )]
public string OperUser { get; set; }
public string? OperUser { get; set; }
/// <summary>
/// 操作Ip
///</summary>

View File

@@ -62,12 +62,12 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="UserName" )]
public string UserName { get; set; }
public string? UserName { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Password" )]
public string Password { get; set; }
public string? Password { get; set; }
/// <summary>
///
///</summary>

View File

@@ -83,6 +83,108 @@ namespace Yi.Framework.Model.SeedData
IsDeleted = false
};
Entitys.Add(tool);
//swagger文档
MenuEntity swagger = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "接口文档",
MenuType = MenuTypeEnum.Menu.GetHashCode(),
Router = "http://localhost:19001",
IsShow = true,
IsLink = true,
MenuIcon = "list",
OrderNum = 100,
ParentId = tool.Id,
IsDeleted = false,
};
Entitys.Add(swagger);
//业务功能
MenuEntity business = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "业务功能",
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
Router = "/business",
IsShow = true,
IsLink = false,
MenuIcon = "international",
OrderNum = 97,
ParentId = 0,
IsDeleted = false
};
Entitys.Add(business);
//文章管理
MenuEntity article = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "文章管理",
PermissionCode = "business:article:list",
MenuType = MenuTypeEnum.Menu.GetHashCode(),
Router = "article",
IsShow = true,
IsLink = false,
IsCache = true,
Component = "business/article/index",
MenuIcon = "education",
OrderNum = 100,
ParentId = business.Id,
IsDeleted = false
};
Entitys.Add(article);
MenuEntity articleQuery = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "文章查询",
PermissionCode = "business:article:query",
MenuType = MenuTypeEnum.Component.GetHashCode(),
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
Entitys.Add(articleQuery);
MenuEntity articleAdd = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "文章新增",
PermissionCode = "business:article:add",
MenuType = MenuTypeEnum.Component.GetHashCode(),
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
Entitys.Add(articleAdd);
MenuEntity articleEdit = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "文章修改",
PermissionCode = "business:article:edit",
MenuType = MenuTypeEnum.Component.GetHashCode(),
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
Entitys.Add(articleEdit);
MenuEntity articleRemove = new MenuEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
MenuName = "文章删除",
PermissionCode = "business:article:remove",
MenuType = MenuTypeEnum.Component.GetHashCode(),
OrderNum = 100,
ParentId = article.Id,
IsDeleted = false
};
Entitys.Add(articleRemove);
//Yi框架
MenuEntity guide = new MenuEntity()
@@ -100,7 +202,6 @@ namespace Yi.Framework.Model.SeedData
};
Entitys.Add(guide);
//用户管理
MenuEntity user = new MenuEntity()
{

View File

@@ -230,7 +230,15 @@ namespace Yi.Framework.WebCore
public static LoginLogEntity GetLoginLogInfo(this HttpContext context)
{
var ipAddr = context.GetClientIp();
var location = IpTool.Search(ipAddr);
IpInfo location;
if (ipAddr == "127.0.0.1")
{
location = new IpInfo() { Province = "本地", City = "本机" };
}
else
{
location = IpTool.Search(ipAddr);
}
ClientInfo clientInfo = context.GetClientInfo();
LoginLogEntity entity = new()
{