Merge branch 'Test.IRC' of http://192.168.3.69:2000/XCKJ/irc-netcore-api into Test.IRC
commit
07a600c05f
|
@ -51,7 +51,7 @@ namespace IRaCIS.Core.API
|
||||||
var path = context.Request.Path.Value;
|
var path = context.Request.Path.Value;
|
||||||
var isIRacisFile = path.StartsWith($"/{StaticData.Folder.IRaCISDataFolder}");
|
var isIRacisFile = path.StartsWith($"/{StaticData.Folder.IRaCISDataFolder}");
|
||||||
|
|
||||||
var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}");
|
var isDicomFile = isIRacisFile && path.Contains($"{StaticData.Folder.DicomFolder}");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,5 +110,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpDelete("{commonDocumentId:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeleteCommonDocument(Guid commonDocumentId)
|
||||||
|
{
|
||||||
|
var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true);
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
||||||
return _accessor?.HttpContext?.Connection.RemoteIpAddress.ToString();
|
return _accessor?.HttpContext.GetClientIP();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,4 +341,33 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class HttpContextExtension
|
||||||
|
{
|
||||||
|
public static string GetClientIP(this HttpContext context)
|
||||||
|
{
|
||||||
|
var ip = context.Request.Headers["Cdn-Src-Ip"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(ip))
|
||||||
|
return IpReplace(ip);
|
||||||
|
|
||||||
|
ip = context.Request.Headers["X-Forwarded-For"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(ip))
|
||||||
|
return IpReplace(ip);
|
||||||
|
|
||||||
|
ip = context.Connection.RemoteIpAddress.ToString();
|
||||||
|
|
||||||
|
return IpReplace(ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
static string IpReplace(string inip)
|
||||||
|
{
|
||||||
|
//::ffff:
|
||||||
|
//::ffff:192.168.2.131 这种IP处理
|
||||||
|
if (inip.Contains("::ffff:"))
|
||||||
|
{
|
||||||
|
inip = inip.Replace("::ffff:", "");
|
||||||
|
}
|
||||||
|
return inip;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue