修改scp 配置
parent
781a4a7b0b
commit
65e50fec54
|
@ -366,17 +366,25 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
{
|
{
|
||||||
public static string GetClientIP(this HttpContext context)
|
public static string GetClientIP(this HttpContext context)
|
||||||
{
|
{
|
||||||
var ip = context.Request.Headers["Cdn-Src-Ip"].FirstOrDefault();
|
//scp 服务创建的记录不能获取请求上下文
|
||||||
if (!string.IsNullOrEmpty(ip))
|
if (context != null)
|
||||||
|
{
|
||||||
|
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);
|
return IpReplace(ip);
|
||||||
|
}
|
||||||
ip = context.Request.Headers["X-Forwarded-For"].FirstOrDefault();
|
else
|
||||||
if (!string.IsNullOrEmpty(ip))
|
{
|
||||||
return IpReplace(ip);
|
return string.Empty;
|
||||||
|
}
|
||||||
ip = context.Connection.RemoteIpAddress.ToString();
|
|
||||||
|
|
||||||
return IpReplace(ip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static string IpReplace(string inip)
|
static string IpReplace(string inip)
|
||||||
|
|
|
@ -75,6 +75,8 @@ public class TaskInstanceConfigration : IEntityTypeConfiguration<TaskInstance>
|
||||||
public void Configure(EntityTypeBuilder<TaskInstance> builder)
|
public void Configure(EntityTypeBuilder<TaskInstance> builder)
|
||||||
{
|
{
|
||||||
builder.HasKey(e => e.SeqId);
|
builder.HasKey(e => e.SeqId);
|
||||||
|
|
||||||
|
builder.HasOne(e => e.TaskStudy).WithMany(t=>t.InstanceList).HasForeignKey(t => t.StudyId).HasPrincipalKey(st => st.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +106,8 @@ public class SCPInstanceConfigration : IEntityTypeConfiguration<SCPInstance>
|
||||||
public void Configure(EntityTypeBuilder<SCPInstance> builder)
|
public void Configure(EntityTypeBuilder<SCPInstance> builder)
|
||||||
{
|
{
|
||||||
builder.HasKey(e => e.SeqId);
|
builder.HasKey(e => e.SeqId);
|
||||||
|
|
||||||
|
builder.HasOne(e => e.SCPStudy).WithMany(t => t.InstanceList).HasForeignKey(t => t.StudyId).HasPrincipalKey(st => st.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue