:zap:优化登录
This commit is contained in:
@@ -5,8 +5,6 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Infrastructure
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Infrastructure.Extensions;
|
||||
using IPTools.Core;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -197,14 +198,24 @@ namespace Infrastructure.WebExtensins
|
||||
return c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据IP获取地理位置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetIpInfo(string IP)
|
||||
{
|
||||
var ipInfo = IpTool.Search(IP);
|
||||
return ipInfo?.Province + "-" + ipInfo?.City + "-" + ipInfo?.NetworkOperator;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置请求参数
|
||||
/// </summary>
|
||||
/// <param name="reqMethod"></param>
|
||||
/// <param name="context"></param>
|
||||
public static string GetRequestValue(this HttpContext context,string reqMethod)
|
||||
public static string GetRequestValue(this HttpContext context, string reqMethod)
|
||||
{
|
||||
string param= string.Empty;
|
||||
string param = string.Empty;
|
||||
|
||||
if (HttpMethods.IsPost(reqMethod) || HttpMethods.IsPut(reqMethod) || HttpMethods.IsDelete(reqMethod))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user