1
This commit is contained in:
@@ -12,6 +12,13 @@
|
||||
options.LogoutPath = "/admin/logout";
|
||||
options.ExpireTimeSpan = TimeSpan.FromDays(3);
|
||||
options.SlidingExpiration = true;
|
||||
|
||||
options.Events.OnRedirectToAccessDenied =
|
||||
options.Events.OnRedirectToLogin = c =>
|
||||
{
|
||||
c.Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||
return Task.FromResult(Result.Error("请登录后操作!"));
|
||||
};
|
||||
});
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ global using System.Text;
|
||||
global using System.Web;
|
||||
global using Dapper;
|
||||
global using FluentMigrator;
|
||||
global using FluentMigrator.Runner;
|
||||
global using Fluid;
|
||||
global using Fluid.ViewEngine;
|
||||
global using Microsoft.AspNetCore.Authentication;
|
||||
@@ -34,13 +35,12 @@ global using Yes.Domain.Configurations;
|
||||
global using Yes.Domain.Core.Data;
|
||||
global using Yes.Domain.Core.Enums;
|
||||
global using Yes.Domain.Core.Exceptions;
|
||||
global using Yes.Domain.Core.Ioc;
|
||||
global using Yes.Domain.Users;
|
||||
global using Yes.Infrastructure.Authorizations.Identity.Context;
|
||||
global using Yes.Infrastructure.Authorizations.Identity.Authroizations;
|
||||
global using Yes.Infrastructure.Authorizations.Identity;
|
||||
global using Yes.Infrastructure.Data.DbContexts;
|
||||
global using Yes.Domain.Core.Extensions;
|
||||
global using FluentMigrator.Runner;
|
||||
global using Yes.Infrastructure.Migrator;
|
||||
global using Yes.Domain.Core.Ioc;
|
||||
global using Yes.Domain.Core.Models;
|
||||
global using Yes.Domain.Users;
|
||||
global using Yes.Infrastructure.Authorizations.Identity;
|
||||
global using Yes.Infrastructure.Authorizations.Identity.Authroizations;
|
||||
global using Yes.Infrastructure.Authorizations.Identity.Context;
|
||||
global using Yes.Infrastructure.Data.DbContexts;
|
||||
global using Yes.Infrastructure.Migrator.Migrations;
|
||||
@@ -2,12 +2,12 @@
|
||||
{
|
||||
public static class BlogResultExtensions
|
||||
{
|
||||
public static IResult BlogView(this IResultExtensions result, string theme, string viewName)
|
||||
public static Microsoft.AspNetCore.Http.IResult BlogView(this IResultExtensions result, string theme, string viewName)
|
||||
{
|
||||
return new BlogViewResult(theme, viewName);
|
||||
}
|
||||
|
||||
public static IResult BlogView(this IResultExtensions result, string theme, string viewName, object model)
|
||||
public static Microsoft.AspNetCore.Http.IResult BlogView(this IResultExtensions result, string theme, string viewName, object model)
|
||||
{
|
||||
return new BlogViewResult(theme, viewName, model);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Yes.Infrastructure.ViewEngine
|
||||
{
|
||||
public class BlogViewResult : IResult
|
||||
public class BlogViewResult : Microsoft.AspNetCore.Http.IResult
|
||||
{
|
||||
private readonly string _theme;
|
||||
private readonly string _viewName;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<PackageReference Include="FluentMigrator.Runner" Version="6.2.0" />
|
||||
<PackageReference Include="Fluid.ViewEngine" Version="2.16.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.OpenApi" Version="1.6.17" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.2.efcore.9.0.0" />
|
||||
<PackageReference Include="MySql.Data" Version="9.1.0" />
|
||||
|
||||
Reference in New Issue
Block a user