增加后台功能

This commit is contained in:
2018-04-15 23:30:15 +08:00
parent 8f92efaf7b
commit 42335efe55
1118 changed files with 296710 additions and 4 deletions
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
namespace COMCMS.Common
{
/// <summary>
/// 获取HttpContext
/// </summary>
public static class MyHttpContext
{
public static IServiceProvider ServiceProvider;
static MyHttpContext()
{ }
public static HttpContext Current
{
get
{
object factory = ServiceProvider.GetService(typeof(IHttpContextAccessor));
HttpContext context = ((IHttpContextAccessor)factory).HttpContext;
return context;
}
}
//需要在sartup中加入
}
}