修改稽查报错
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d10020d944
commit
d852de4a5b
|
@ -366,17 +366,26 @@ 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)
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class SCPInstanceConfigration : IEntityTypeConfiguration<SCPInstance>
|
||||||
{
|
{
|
||||||
builder.HasKey(e => e.SeqId);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue