File tree 4 files changed +3320
-87
lines changed
Infrastructure/Infrastructure/StaticExt
4 files changed +3320
-87
lines changed Original file line number Diff line number Diff line change 10
10
4 . 权限管理[ 精确到按钮] )
11
11
5 . 代码生成器
12
12
13
+ 角色支持遗传,比如 :共有ABCD四个功能权限,分配了 A B 2个权限给 超级管理员角色的用户,支持让超级管理员用户还能自己创建角色。但是只能选择 A B 2个。无法看到 C D!
14
+
15
+
13
16
14
17
# 如何使用 wiki:https://github.com/yuzd/AntMgr/wiki
15
18
代码克隆到本地 用vs2017或以上版本 打开工程。
94
97
在页面里面写需要权限控制的按钮的时候
95
98
96
99
```
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>
98
101
99
102
```
100
103
103
106
action-id | 表示这个权限按钮的id 在当前view唯一
104
107
action-name | 权限按钮的作用描述
105
108
display | 默认使用 none 隐藏
106
-
109
+ class | 必须有 authorization
107
110
108
111
只要遵守如上2个约定开发好页面和controller后,按照如下步骤进行配置权限
109
112
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class CodingUtils
18
18
{
19
19
20
20
21
-
21
+
22
22
/// <summary>
23
23
/// MD5函数
24
24
/// </summary>
@@ -51,9 +51,9 @@ public static string AesEncrypt(string toEncrypt)
51
51
}
52
52
try
53
53
{
54
- byte [ ] keyArray = UTF8Encoding . UTF8 . GetBytes ( @"F30F6FD087514424B671C397AF1C1C51 " ) ;
54
+ byte [ ] keyArray = Encoding . UTF8 . GetBytes ( @"7BF45189A0ED4BD6BE7936EFD11169E7 " ) ;
55
55
56
- byte [ ] toEncryptArray = UTF8Encoding . UTF8 . GetBytes ( toEncrypt ) ;
56
+ byte [ ] toEncryptArray = Encoding . UTF8 . GetBytes ( toEncrypt ) ;
57
57
58
58
RijndaelManaged rDel = new RijndaelManaged ( ) ;
59
59
rDel . Key = keyArray ;
@@ -85,7 +85,7 @@ public static string AesDecrypt(string toDecrypt)
85
85
try
86
86
{
87
87
88
- byte [ ] keyArray = UTF8Encoding . UTF8 . GetBytes ( @"F30F6FD087514424B671C397AF1C1C51 " ) ;
88
+ byte [ ] keyArray = Encoding . UTF8 . GetBytes ( @"7BF45189A0ED4BD6BE7936EFD11169E7 " ) ;
89
89
90
90
byte [ ] toEncryptArray = Convert . FromBase64String ( toDecrypt ) ;
91
91
@@ -94,6 +94,7 @@ public static string AesDecrypt(string toDecrypt)
94
94
rDel . Mode = CipherMode . ECB ;
95
95
rDel . Padding = PaddingMode . PKCS7 ;
96
96
97
+
97
98
ICryptoTransform cTransform = rDel . CreateDecryptor ( ) ;
98
99
byte [ ] resultArray = cTransform . TransformFinalBlock ( toEncryptArray , 0 , toEncryptArray . Length ) ;
99
100
@@ -108,7 +109,7 @@ public static string AesDecrypt(string toDecrypt)
108
109
#endregion
109
110
110
111
111
-
112
+
112
113
113
114
}
114
115
}
Original file line number Diff line number Diff line change @@ -101,13 +101,15 @@ private string RenderMenu(List<SystemMenuSM> menuList)
101
101
//增加对固定Url的展示
102
102
if ( ! string . IsNullOrEmpty ( child2 . Url ) && child2 . Url . ToLower ( ) . StartsWith ( "http" ) )
103
103
{
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 +
105
106
"</a></li > " ) ;
106
107
}
107
108
else
108
109
{
109
110
//只有第二层
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 +
111
113
"</a></li > " ) ;
112
114
}
113
115
}
@@ -121,7 +123,8 @@ private string RenderMenu(List<SystemMenuSM> menuList)
121
123
122
124
foreach ( var child3 in child2 . ChildMunuList )
123
125
{
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 +
125
128
"</a></li>" ) ;
126
129
}
127
130
sb . AppendLine ( "</ul>" ) ;
You can’t perform that action at this time.
0 commit comments