diff --git a/.gitignore b/.gitignore index 3f99431e..f4f24c36 100644 --- a/.gitignore +++ b/.gitignore @@ -348,7 +348,7 @@ ASALocalRun/ # Net Core Keys **/[Kk]eys/*.xml -Bootstrap.Admin.xml +Bootstrap.*.xml ###### -- Custom Ignore Section, Make sure all files you add to the git repo are below this line -- ###### diff --git a/Directory.Build.props b/Directory.Build.props index 8a3dd083..cd66f379 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,7 @@ latest true $(MSBuildThisFileDirectory)src\Keys\Longbow.Utility.snk + $(MSBuildProjectName).xml diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj index 64ca91b4..20e78332 100644 --- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -6,16 +6,16 @@ - $(MSBuildProjectName).xml Windows - - + + + diff --git a/src/admin/Bootstrap.Admin/Startup.cs b/src/admin/Bootstrap.Admin/Startup.cs index f733c896..685351ab 100644 --- a/src/admin/Bootstrap.Admin/Startup.cs +++ b/src/admin/Bootstrap.Admin/Startup.cs @@ -60,7 +60,7 @@ namespace Bootstrap.Admin services.AddSignalR().AddJsonProtocol(op => op.PayloadSerializerOptions.AddDefaultConverters()); services.AddSignalRExceptionFilterHandler(async (client, ex) => await client.SendMessageBody(ex).ConfigureAwait(false)); services.AddResponseCompression(); - services.AddBootstrapAdminAuthentication().AddGitee(OAuthHelper.Configure).AddGitHub(OAuthHelper.Configure); + services.AddBootstrapAdminAuthentication(Configuration).AddGitee(OAuthHelper.Configure).AddGitHub(OAuthHelper.Configure); services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireBootstrapAdminAuthorizate().Build()); services.AddSwagger(); services.AddButtonAuthorization(MenuHelper.AuthorizateButtons); @@ -107,7 +107,7 @@ namespace Bootstrap.Admin app.UseStaticFiles(); app.UseAutoGenerateDatabase(); app.UseRouting(); - app.UseBootstrapAdminAuthentication("", RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName); + app.UseBootstrapAdminAuthentication("0", RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName); app.UseAuthorization(); app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/')); app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save); diff --git a/src/admin/Bootstrap.DataAccess.MongoDB/Bootstrap.DataAccess.MongoDB.csproj b/src/admin/Bootstrap.DataAccess.MongoDB/Bootstrap.DataAccess.MongoDB.csproj index 535de425..a2a4fb89 100644 --- a/src/admin/Bootstrap.DataAccess.MongoDB/Bootstrap.DataAccess.MongoDB.csproj +++ b/src/admin/Bootstrap.DataAccess.MongoDB/Bootstrap.DataAccess.MongoDB.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index 51aa25c4..1babcfd1 100644 --- a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -5,22 +5,22 @@ - - - - - - - - + + + + + + + + - - - + + + - + diff --git a/src/admin/Bootstrap.DataAccess/Helper/LoginHelper.cs b/src/admin/Bootstrap.DataAccess/Helper/LoginHelper.cs index eb74d069..7322fd21 100644 --- a/src/admin/Bootstrap.DataAccess/Helper/LoginHelper.cs +++ b/src/admin/Bootstrap.DataAccess/Helper/LoginHelper.cs @@ -17,7 +17,9 @@ namespace Bootstrap.DataAccess /// /// 记录登陆日志方法 /// - /// + /// + /// 登录用户名 + /// 是否登录成功 /// public static bool Log(this HttpContext context, string userName, bool auth) { diff --git a/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj b/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj index 21cdf460..90d7095a 100644 --- a/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj +++ b/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj @@ -5,12 +5,12 @@ - - - - - - + + + + + + diff --git a/src/client/Bootstrap.Client/Bootstrap.Client.csproj b/src/client/Bootstrap.Client/Bootstrap.Client.csproj index 40292255..f82a4cab 100644 --- a/src/client/Bootstrap.Client/Bootstrap.Client.csproj +++ b/src/client/Bootstrap.Client/Bootstrap.Client.csproj @@ -6,9 +6,10 @@ - - + + + diff --git a/src/client/Bootstrap.Client/Models/ModelBase.cs b/src/client/Bootstrap.Client/Models/ModelBase.cs index 6f488b41..b93c5b91 100644 --- a/src/client/Bootstrap.Client/Models/ModelBase.cs +++ b/src/client/Bootstrap.Client/Models/ModelBase.cs @@ -19,6 +19,9 @@ namespace Bootstrap.Client.Models Theme = DictHelper.RetrieveActiveTheme(); } + /// + /// 获得 应用程序标识 + /// public string AppId { get; private set; } /// diff --git a/src/client/Bootstrap.Client/Startup.cs b/src/client/Bootstrap.Client/Startup.cs index 57750501..e5ce97fc 100644 --- a/src/client/Bootstrap.Client/Startup.cs +++ b/src/client/Bootstrap.Client/Startup.cs @@ -53,7 +53,7 @@ namespace Bootstrap.Client services.AddIPLocator(DictHelper.ConfigIPLocator); services.AddOnlineUsers(); services.AddResponseCompression(); - services.AddBootstrapAdminAuthentication(); + services.AddBootstrapAdminAuthentication(Configuration); services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireBootstrapAdminAuthorizate().Build()); services.AddControllersWithViews(options => options.Filters.Add()).AddJsonOptions(op => op.JsonSerializerOptions.AddDefaultConverters()); services.AddAutoPublish(); @@ -86,7 +86,7 @@ namespace Bootstrap.Client app.UseCookiePolicy(); app.UseRouting(); - app.UseBootstrapAdminAuthentication(Configuration.GetValue("AppId", "2"), RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName); + app.UseBootstrapAdminAuthentication("2", RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName); app.UseAuthorization(); app.UseCacheManager(); app.UseOnlineUsers(callback: TraceHelper.Save); diff --git a/test/UnitTest/UnitTest.csproj b/test/UnitTest/UnitTest.csproj index fdcf782b..0979a9d2 100644 --- a/test/UnitTest/UnitTest.csproj +++ b/test/UnitTest/UnitTest.csproj @@ -18,7 +18,7 @@ - +