-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from i66soft/dev/develop
3.1.2-preview3-26
- Loading branch information
Showing
227 changed files
with
11,014 additions
and
6,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
samples/web/Liuliu.Demo.Core/Authorization/ModuleSeedDataInitializer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ModuleSeedDataInitializer.cs" company="OSharp开源团队"> | ||
// Copyright (c) 2014-2020 OSharp. All rights reserved. | ||
// </copyright> | ||
// <site>http://www.osharp.org</site> | ||
// <last-editor>郭明锋</last-editor> | ||
// <last-date>2020-03-07 1:01</last-date> | ||
// ----------------------------------------------------------------------- | ||
|
||
using System; | ||
using System.Linq.Expressions; | ||
|
||
using Liuliu.Demo.Authorization.Entities; | ||
|
||
using OSharp.Entity; | ||
|
||
|
||
namespace Liuliu.Demo.Authorization | ||
{ | ||
public class ModuleSeedDataInitializer : SeedDataInitializerBase<Module, int> | ||
{ | ||
/// <summary> | ||
/// 初始化一个<see cref="SeedDataInitializerBase{TEntity, TKey}"/>类型的新实例 | ||
/// </summary> | ||
public ModuleSeedDataInitializer(IServiceProvider rootProvider) | ||
: base(rootProvider) | ||
{ } | ||
|
||
/// <summary> | ||
/// 重写以提供要初始化的种子数据 | ||
/// </summary> | ||
/// <returns></returns> | ||
protected override Module[] SeedData() | ||
{ | ||
return new[] | ||
{ | ||
new Module(){Id=1, Name = "根节点", Remark = "系统根节点", Code = "Root", OrderCode = 1, TreePathString = "$1$"}, | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// 重写以提供判断某个实体是否存在的表达式 | ||
/// </summary> | ||
/// <param name="entity">要判断的实体</param> | ||
/// <returns></returns> | ||
protected override Expression<Func<Module, bool>> ExistingExpression(Module entity) | ||
{ | ||
return m => m.TreePathString == entity.TreePathString; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
samples/web/Liuliu.Demo.Core/Identity/AuthenticationPack.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="AuthenticationPack.cs" company="OSharp开源团队"> | ||
// Copyright (c) 2014-2020 OSharp. All rights reserved. | ||
// </copyright> | ||
// <site>http://www.osharp.org</site> | ||
// <last-editor>郭明锋</last-editor> | ||
// <last-date>2020-03-02 21:21</last-date> | ||
// ----------------------------------------------------------------------- | ||
|
||
using Liuliu.Demo.Identity.Entities; | ||
using Liuliu.Demo.Identity.Events; | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
using OSharp.Authentication; | ||
using OSharp.Core.Packs; | ||
|
||
|
||
namespace Liuliu.Demo.Identity | ||
{ | ||
/// <summary> | ||
/// 身份认证模块 | ||
/// </summary> | ||
[DependsOnPacks(typeof(IdentityPack))] | ||
public class AuthenticationPack : AuthenticationPackBase<User, int> | ||
{ | ||
/// <summary> | ||
/// 将模块服务添加到依赖注入服务容器中 | ||
/// </summary> | ||
/// <param name="services">依赖注入服务容器</param> | ||
/// <returns></returns> | ||
public override IServiceCollection AddServices(IServiceCollection services) | ||
{ | ||
services.AddEventHandler<Logout_RemoveRefreshTokenEventHandler>(); | ||
|
||
return base.AddServices(services); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.