Skip to content

Commit 3d1e788

Browse files
author
1877682825@qq.com
committed
创建菜单时 支持选择ico
1 parent 8eb2e42 commit 3d1e788

File tree

4 files changed

+3320
-87
lines changed

4 files changed

+3320
-87
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
4. 权限管理[精确到按钮]
1111
5. 代码生成器
1212

13+
角色支持遗传,比如 :共有ABCD四个功能权限,分配了 A B 2个权限给 超级管理员角色的用户,支持让超级管理员用户还能自己创建角色。但是只能选择 A B 2个。无法看到 C D!
14+
15+
1316

1417
# 如何使用 wiki:https://github.com/yuzd/AntMgr/wiki
1518
代码克隆到本地 用vs2017或以上版本 打开工程。
@@ -94,7 +97,7 @@
9497
在页面里面写需要权限控制的按钮的时候
9598

9699
```
97-
<button type="button" action-id="role-add" action-name="新增角色" style="display: none" >新增角色</button>
100+
<button type="button" class="authorization" action-id="role-add" action-name="新增角色" style="display: none" >新增角色</button>
98101
99102
```
100103

@@ -103,7 +106,7 @@
103106
action-id | 表示这个权限按钮的id 在当前view唯一
104107
action-name | 权限按钮的作用描述
105108
display | 默认使用 none 隐藏
106-
109+
class | 必须有 authorization
107110

108111
只要遵守如上2个约定开发好页面和controller后,按照如下步骤进行配置权限
109112

ant.mgr/Infrastructure/Infrastructure/StaticExt/CodingUtils.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CodingUtils
1818
{
1919

2020

21-
21+
2222
/// <summary>
2323
/// MD5函数
2424
/// </summary>
@@ -51,9 +51,9 @@ public static string AesEncrypt(string toEncrypt)
5151
}
5252
try
5353
{
54-
byte[] keyArray = UTF8Encoding.UTF8.GetBytes(@"F30F6FD087514424B671C397AF1C1C51");
54+
byte[] keyArray = Encoding.UTF8.GetBytes(@"7BF45189A0ED4BD6BE7936EFD11169E7");
5555

56-
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
56+
byte[] toEncryptArray = Encoding.UTF8.GetBytes(toEncrypt);
5757

5858
RijndaelManaged rDel = new RijndaelManaged();
5959
rDel.Key = keyArray;
@@ -85,7 +85,7 @@ public static string AesDecrypt(string toDecrypt)
8585
try
8686
{
8787

88-
byte[] keyArray = UTF8Encoding.UTF8.GetBytes(@"F30F6FD087514424B671C397AF1C1C51");
88+
byte[] keyArray = Encoding.UTF8.GetBytes(@"7BF45189A0ED4BD6BE7936EFD11169E7");
8989

9090
byte[] toEncryptArray = Convert.FromBase64String(toDecrypt);
9191

@@ -94,6 +94,7 @@ public static string AesDecrypt(string toDecrypt)
9494
rDel.Mode = CipherMode.ECB;
9595
rDel.Padding = PaddingMode.PKCS7;
9696

97+
9798
ICryptoTransform cTransform = rDel.CreateDecryptor();
9899
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
99100

@@ -108,7 +109,7 @@ public static string AesDecrypt(string toDecrypt)
108109
#endregion
109110

110111

111-
112+
112113

113114
}
114115
}

ant.mgr/mgr.core/App_Start/CustomViewEngine.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ private string RenderMenu(List<SystemMenuSM> menuList)
101101
//增加对固定Url的展示
102102
if (!string.IsNullOrEmpty(child2.Url) && child2.Url.ToLower().StartsWith("http"))
103103
{
104-
sb.AppendLine(" <li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child2.Url) ? "#" : child2.Url) + "\">" + child2.Name +
104+
sb.AppendLine($" <li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child2.Url) ? "#" : child2.Url) + "\"> <i class=\"" + child2.Class +
105+
"\"></i>" + child2.Name +
105106
"</a></li > ");
106107
}
107108
else
108109
{
109110
//只有第二层
110-
sb.AppendLine(" <li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child2.Url) ? "#" : Url.Content(child2.Url)) + "\">" + child2.Name +
111+
sb.AppendLine($" <li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child2.Url) ? "#" : Url.Content(child2.Url)) + "\"><i class=\"" + child2.Class +
112+
"\"></i>" + child2.Name +
111113
"</a></li > ");
112114
}
113115
}
@@ -121,7 +123,8 @@ private string RenderMenu(List<SystemMenuSM> menuList)
121123

122124
foreach (var child3 in child2.ChildMunuList)
123125
{
124-
sb.AppendLine("<li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child3.Url) ? "#" : Url.Content(child3.Url)) + "\">" + child3.Name +
126+
sb.AppendLine($"<li><a class=\"J_menuItem\" href=\"" + (string.IsNullOrEmpty(child3.Url) ? "#" : Url.Content(child3.Url)) + "\"><i class=\"" + child2.Class +
127+
"\"></i>" + child3.Name +
125128
"</a></li>");
126129
}
127130
sb.AppendLine("</ul>");

0 commit comments

Comments
 (0)