Skip to content

Commit 07779cb

Browse files
committed
vue.admin: permission assign
1 parent cafd19a commit 07779cb

15 files changed

Lines changed: 115 additions & 33 deletions

Blog.Core.Common/Helper/RecursionHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void LoopToAppendChildren(List<PermissionTree> all, PermissionTree
3434

3535
if (curItem.isbtn)
3636
{
37-
curItem.label += "按钮";
37+
//curItem.label += "按钮";
3838
}
3939

4040
foreach (var subItem in subItems)
@@ -49,7 +49,7 @@ public static void LoopToAppendChildren(List<PermissionTree> all, PermissionTree
4949

5050
public static void LoopToAppendChildrenT<T>(List<T> all, T curItem, string parentIdName = "Pid", string idName = "value", string childrenName = "children")
5151
{
52-
var subItems = all.Where(ee => ee.GetType().GetProperty(parentIdName).GetValue(ee, null).ToString() == curItem.GetType().GetProperty(idName).GetValue(curItem, null).ToString()).ToList(); //新闻1
52+
var subItems = all.Where(ee => ee.GetType().GetProperty(parentIdName).GetValue(ee, null).ToString() == curItem.GetType().GetProperty(idName).GetValue(curItem, null).ToString()).ToList();
5353

5454
if (subItems.Count > 0) curItem.GetType().GetField(childrenName).SetValue(curItem, subItems);
5555
foreach (var subItem in subItems)

Blog.Core.Model/Models/Module.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Module()
9696
/// 创建时间
9797
/// </summary>
9898
[SugarColumn(IsNullable = true)]
99-
public DateTime CreateTime { get; set; }
99+
public DateTime CreateTime { get; set; } = DateTime.Now;
100100
/// <summary>
101101
/// 修改ID
102102
/// </summary>
@@ -111,7 +111,7 @@ public Module()
111111
/// 修改时间
112112
/// </summary>
113113
[SugarColumn(IsNullable = true)]
114-
public DateTime? ModifyTime { get; set; }
114+
public DateTime? ModifyTime { get; set; } = DateTime.Now;
115115

116116
//public virtual Module ParentModule { get; set; }
117117
//public virtual ICollection<Module> ChildModule { get; set; }

Blog.Core.Model/Models/Permission.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Permission()
7575
/// 创建时间
7676
/// </summary>
7777
[SugarColumn(IsNullable = true)]
78-
public DateTime? CreateTime { get; set; }
78+
public DateTime? CreateTime { get; set; } = DateTime.Now;
7979
/// <summary>
8080
/// 修改ID
8181
/// </summary>
@@ -90,7 +90,7 @@ public Permission()
9090
/// 修改时间
9191
/// </summary>
9292
[SugarColumn(IsNullable = true)]
93-
public DateTime? ModifyTime { get; set; }
93+
public DateTime? ModifyTime { get; set; } = DateTime.Now;
9494

9595
/// <summary>
9696
///获取或设置是否禁用,逻辑上的删除,非物理删除

Blog.Core.Model/Models/Role.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Role(string name)
6767
/// 创建时间
6868
/// </summary>
6969
[SugarColumn( IsNullable = true)]
70-
public DateTime? CreateTime { get; set; }
70+
public DateTime? CreateTime { get; set; } = DateTime.Now;
7171
/// <summary>
7272
/// 修改ID
7373
/// </summary>
@@ -82,7 +82,7 @@ public Role(string name)
8282
/// 修改时间
8383
/// </summary>
8484
[SugarColumn( IsNullable = true)]
85-
public DateTime? ModifyTime { get; set; }
85+
public DateTime? ModifyTime { get; set; } = DateTime.Now;
8686

8787

8888
}

Blog.Core.Model/Models/RoleModulePermission.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class RoleModulePermission : RootEntity
1010
{
1111
public RoleModulePermission()
1212
{
13-
this.Role = new Role();
14-
this.Module = new Module();
15-
this.Permission = new Permission();
13+
//this.Role = new Role();
14+
//this.Module = new Module();
15+
//this.Permission = new Permission();
1616

1717
}
1818

@@ -48,7 +48,7 @@ public RoleModulePermission()
4848
/// 创建时间
4949
/// </summary>
5050
[SugarColumn(IsNullable = true)]
51-
public DateTime? CreateTime { get; set; }
51+
public DateTime? CreateTime { get; set; } = DateTime.Now;
5252
/// <summary>
5353
/// 修改ID
5454
/// </summary>
@@ -63,14 +63,14 @@ public RoleModulePermission()
6363
/// 修改时间
6464
/// </summary>
6565
[SugarColumn(IsNullable = true)]
66-
public DateTime? ModifyTime { get; set; }
66+
public DateTime? ModifyTime { get; set; } = DateTime.Now;
6767

6868
// 下边三个实体参数,只是做传参作用,所以忽略下
6969
[SugarColumn(IsIgnore = true)]
70-
public virtual Role Role { get; set; }
70+
public Role Role { get; set; }
7171
[SugarColumn(IsIgnore = true)]
72-
public virtual Module Module { get; set; }
72+
public Module Module { get; set; }
7373
[SugarColumn(IsIgnore = true)]
74-
public virtual Permission Permission { get; set; }
74+
public Permission Permission { get; set; }
7575
}
7676
}

Blog.Core.Repository/RoleModulePermissionRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public class RoleModulePermissionRepository : BaseRepository<RoleModulePermissio
1414

1515
public async Task<List<RoleModulePermission>> WithChildrenModel()
1616
{
17-
var list = await Task.Run(() => Db.Queryable<RoleModulePermission>()
18-
.Mapper(it => it.Role, it => it.RoleId)
19-
.Mapper(it => it.Module, it => it.ModuleId).ToList());
17+
//var list = await Task.Run(() => Db.Queryable<RoleModulePermission>()
18+
// .Mapper(it => it.Role, it => it.RoleId)
19+
// .Mapper(it => it.Module, it => it.ModuleId).ToList());
2020

21-
return list;
21+
return null;
2222
}
2323

2424
}

Blog.Core/Blog.Core.Model.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Blog.Core/Blog.Core.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Blog.Core/Controllers/ClaimsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Blog.Core.Controllers
1010
{
11-
[Authorize("Permission")]
11+
//[Authorize("Permission")]
1212
[Route("api/Claims")]
1313
[ApiController]
1414
public class ClaimsController : Controller

Blog.Core/Controllers/ModuleController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Blog.Core.Controllers
1313
{
1414
[Route("api/[controller]/[action]")]
1515
[ApiController]
16-
//[Authorize("Permission")]
16+
[Authorize("Permission")]
1717
public class ModuleController : ControllerBase
1818
{
1919
IModuleServices _ModuleServices;

0 commit comments

Comments
 (0)