修改缓存判断逻辑
parent
f732edfc6f
commit
cbfae4126c
|
@ -20,18 +20,20 @@ namespace IRaCIS.Core.API
|
|||
// Set all the common properties available for every request
|
||||
diagnosticContext.Set("Host", request.Host);
|
||||
|
||||
diagnosticContext.Set("Protocol", request.Protocol);
|
||||
diagnosticContext.Set("Scheme", request.Scheme);
|
||||
|
||||
#region old 未用
|
||||
//这种获取的Ip不准 配置服务才行
|
||||
//diagnosticContext.Set("RequestIP", httpContext.Connection.RemoteIpAddress.ToString());
|
||||
|
||||
//这种方式可以,但是serilog提供了 就不用了
|
||||
//diagnosticContext.Set("TestIP", httpContext.GetUserIp());
|
||||
|
||||
diagnosticContext.Set("Protocol", request.Protocol);
|
||||
diagnosticContext.Set("Scheme", request.Scheme);
|
||||
|
||||
//这种方式不行 读取的body为空字符串 必须在中间件中读取
|
||||
//diagnosticContext.Set("RequestBody", await ReadRequestBody(httpContext.Request));
|
||||
//diagnosticContext.Set("RequestBody", RequestPayload);
|
||||
#endregion
|
||||
|
||||
// Only set it if available. You're not sending sensitive data in a querystring right?!
|
||||
if (request.QueryString.HasValue)
|
||||
|
|
|
@ -31,11 +31,9 @@ namespace IRaCIS.Core.API
|
|||
|
||||
options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
|
||||
|
||||
//options.SerializerSettings.Converters.Add(new JSONCustomDateConverter()) ;
|
||||
|
||||
options.SerializerSettings.Converters.Add(services.BuildServiceProvider().GetService<JSONTimeZoneConverter>());
|
||||
|
||||
//options.SerializerSettings.Converters.Add(services.BuildServiceProvider().GetService<CustomStringConverter>());
|
||||
|
||||
|
||||
//IsoDateTimeConverter
|
||||
|
|
|
@ -31,13 +31,13 @@ namespace IRaCIS.Core.API
|
|||
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("LocalIP", httpContext.Connection.LocalIpAddress.MapToIPv4().ToString()));
|
||||
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserRealName", httpContext?.User?.FindFirst(ClaimAttributes.RealName)?.Value));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value));
|
||||
|
||||
|
||||
//这样读取没用
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestBody", await ReadRequestBody(httpContext.Request)));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestIP", IPHelper.GetIP(httpContext.Request) ));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserRealName", httpContext?.User?.FindFirst(ClaimAttributes.RealName)?.Value));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value));
|
||||
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("Referer", httpContext.Request.Headers["Referer"].ToString()));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_path", httpContext.Request.Path));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_method", httpContext.Request.Method));
|
||||
|
|
|
@ -787,10 +787,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
private VerifyStudyUploadResult VerifyStudyUpload(string studyInstanceUid, Guid trialId, Guid currentSubjectVisitId, Guid SubjectId)
|
||||
{
|
||||
|
||||
var cacheUserId = _fusionCache.TryGet<Guid>(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid));
|
||||
|
||||
var result = new VerifyStudyUploadResult();
|
||||
|
||||
if (_fusionCache.GetOrDefault<Guid>(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid)) != _userInfo.Id
|
||||
&& _fusionCache.GetOrDefault<Guid>(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid)) != Guid.Empty)
|
||||
if (cacheUserId.GetValueOrDefault() != _userInfo.Id && cacheUserId.HasValue)
|
||||
{
|
||||
|
||||
result.AllowUpload = false;
|
||||
|
|
|
@ -8,12 +8,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
public class QCCommon: BaseService
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证CRC 是否已提交 已提交 就不允许进行任何操作,如果是IQC 那么还验证是否是当前任务领取人
|
||||
/// </summary>
|
||||
/// <param name="_repository"></param>
|
||||
/// <param name="_subjectVisitRepository"></param>
|
||||
/// <param name="_userInfo"></param>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <returns></returns>
|
||||
|
|
Loading…
Reference in New Issue