数据权限功能

This commit is contained in:
chenchun
2022-09-18 17:22:47 +08:00
parent a64d493a29
commit 483aea5c4f
9 changed files with 170 additions and 115 deletions

View File

@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System;
using Ubiety.Dns.Core.Common;
namespace Yi.Framework.WebCore
{
public static class ServiceLocator
{
public static IServiceProvider Instance { get; set; }
public static string Admin { get; set; } = "cc";
public static bool GetHttp(out HttpContext httpContext)
{
httpContext = null;
var httpContextAccessor = Instance.GetService<IHttpContextAccessor>();
if (httpContextAccessor is null)
{
return false;
}
httpContext = httpContextAccessor.HttpContext;
return true;
}
}
}