2021-08-23 16:57:25 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ZR.Model.System.Vo
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 路由展示
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class RouterVo
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
|
|
|
|
public bool AlwaysShow { get; set; }
|
|
|
|
|
|
private string component;
|
|
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
|
|
|
|
public bool Hidden { get; set; }
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
public string Path { get; set; }
|
|
|
|
|
|
public string Redirect { get; set; }
|
|
|
|
|
|
public Meta Meta { get; set; }
|
|
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
|
|
|
|
public List<RouterVo> Children { get; set; }
|
|
|
|
|
|
public string Component { get => component; set => component = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class Meta
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置该路由在侧边栏和面包屑中展示的名字
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置该路由的图标,对应路径src/assets/icons/svg
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Icon { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置为true,则不会被 <keep-alive>缓存
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool NoCache { get; set; }
|
2022-05-06 22:12:15 +08:00
|
|
|
|
public string TitleKey { get; set; } = string.Empty;
|
2022-06-19 11:38:32 +08:00
|
|
|
|
public string Link { get; set; } = string.Empty;
|
2021-08-23 16:57:25 +08:00
|
|
|
|
|
2022-06-19 11:38:32 +08:00
|
|
|
|
public Meta(string title, string icon)
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = title;
|
|
|
|
|
|
Icon = icon;
|
|
|
|
|
|
}
|
|
|
|
|
|
public Meta(string title, string icon, string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = title;
|
|
|
|
|
|
Icon = icon;
|
|
|
|
|
|
Link = path;
|
|
|
|
|
|
}
|
|
|
|
|
|
public Meta(string title, string icon, bool noCache, string titleKey, string path)
|
2022-05-06 22:12:15 +08:00
|
|
|
|
{
|
|
|
|
|
|
Title = title;
|
|
|
|
|
|
Icon = icon;
|
|
|
|
|
|
NoCache = noCache;
|
2022-05-07 13:37:36 +08:00
|
|
|
|
TitleKey = titleKey;
|
2022-11-17 10:47:43 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(path) && (path.StartsWith(UserConstants.HTTP) || path.StartsWith(UserConstants.HTTPS)))
|
|
|
|
|
|
{
|
|
|
|
|
|
Link = path;
|
|
|
|
|
|
}
|
2022-05-06 22:12:15 +08:00
|
|
|
|
}
|
2021-08-23 16:57:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|