修改稽查报错
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
hang 2024-12-20 12:50:41 +08:00
parent d10020d944
commit d852de4a5b
2 changed files with 20 additions and 11 deletions

View File

@ -365,6 +365,9 @@ namespace IRaCIS.Core.Domain.Share
public static class HttpContextExtension
{
public static string GetClientIP(this HttpContext context)
{
//scp 服务创建的记录不能获取请求上下文
if (context != null)
{
var ip = context.Request.Headers["Cdn-Src-Ip"].FirstOrDefault();
if (!string.IsNullOrEmpty(ip))
@ -378,6 +381,12 @@ namespace IRaCIS.Core.Domain.Share
return IpReplace(ip);
}
else
{
return string.Empty;
}
}
static string IpReplace(string inip)
{

View File

@ -110,7 +110,7 @@ public class SCPInstanceConfigration : IEntityTypeConfiguration<SCPInstance>
{
builder.HasKey(e => e.SeqId);
builder.HasOne(e => e.SCPStudy).WithMany().HasForeignKey(t => t.StudyId).HasPrincipalKey(st => st.Id);
builder.HasOne(e => e.SCPStudy).WithMany(t=>t.InstanceList).HasForeignKey(t => t.StudyId).HasPrincipalKey(st => st.Id);
}
}