From 1a6ec6b315cff197fb8af7150d56da793b77e923 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 29 Dec 2025 11:07:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=B0=83=E7=A0=94=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SiteSurvey/TrialSiteSurveyService.cs | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 6ad158993..26932c113 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -3,35 +3,36 @@ // 生成时间 2021-12-23 13:20:59 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- +using DocumentFormat.OpenXml.Spreadsheet; +using DocumentFormat.OpenXml.Vml.Spreadsheet; +using IdentityModel; +using IdentityModel.OidcClient; using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Application.Service; +using IRaCIS.Core.Application.Service.OAuth; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; +using MassTransit; using Medallion.Threading; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Microsoft.VisualBasic; using MimeKit; using Newtonsoft.Json; +using NPOI.SS.Formula.Functions; +using Panda.DynamicWebApi.Attributes; +using StackExchange.Redis; +using System.Security.Policy; using System.Text.RegularExpressions; using static MassTransit.ValidationResultExtensions; -using DocumentFormat.OpenXml.Vml.Spreadsheet; -using IdentityModel.OidcClient; -using IRaCIS.Core.Domain.Models; -using MassTransit; -using DocumentFormat.OpenXml.Spreadsheet; -using StackExchange.Redis; -using Panda.DynamicWebApi.Attributes; -using IdentityModel; -using Microsoft.AspNetCore.Components.Routing; -using IRaCIS.Core.Application.ViewModel; -using Microsoft.AspNetCore.Identity; -using NPOI.SS.Formula.Functions; -using System.Security.Policy; namespace IRaCIS.Core.Application.Contracts { @@ -703,19 +704,24 @@ namespace IRaCIS.Core.Application.Contracts //删除验证码历史记录 await _verificationCodeRepository.BatchDeleteNoTrackingAsync(t => t.EmailOrPhone == userInfo.EmailOrPhone && t.Code == userInfo.verificationCode && t.CodeType == userInfo.verificationType); + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = null, ActionUserName = $"SiteSurvey_{currentEntity.Email}", OptType = UserOptType.Login, IsLoginUncommonly = false }); await _trialSiteSurveyRepository.SaveChangesAsync(); + var newId = Guid.NewGuid(); + return ResponseOutput.Ok(new { TrialSiteSurveyId = currentEntity!.Id, Token = _tokenService.GetToken(new UserTokenInfo() { - IdentityUserId = Guid.NewGuid(), + IdentityUserId = newId, - UserRoleId = Guid.NewGuid(), + UserRoleId = newId, UserName = $"SiteSurvey_{currentEntity.Email}", UserTypeEnum = UserTypeEnum.Undefined, - }) + }), + IdentityUserId = newId, + UserRoleId = newId }); #endregion @@ -776,7 +782,7 @@ namespace IRaCIS.Core.Application.Contracts .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).FirstOrDefaultAsync().IfNullThrowException(); } - var siteSurveryConfig = _trialRepository.Where(t=>t.Id==trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty; + var siteSurveryConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty; result.SiteSurveyFiledConfig = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new TrialExtraConfig(); return result;