mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 10:19:48 +08:00
添加项目文件。
This commit is contained in:
33
CoreCms.Net.Auth/HttpContextSetup.cs
Normal file
33
CoreCms.Net.Auth/HttpContextSetup.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CoreCms.Net.Auth.HttpContextUser;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace CoreCms.Net.Auth
|
||||
{
|
||||
/// <summary>
|
||||
/// 上下文启动
|
||||
/// </summary>
|
||||
public static class HttpContextSetup
|
||||
{
|
||||
public static void AddHttpContextSetup(this IServiceCollection services)
|
||||
{
|
||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
services.AddScoped<IHttpContextUser, AspNetUser>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user