From e8aa95b7c590797e5a3266fc930b8e4aa5064966 Mon Sep 17 00:00:00 2001 From: zhangtao Date: Mon, 4 Aug 2025 10:10:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(internal/service):=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E7=BD=B2=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -移除了对 UpdateBy 字段的冗余条件判断 - 直接使用 currentUserId 更新 UpdateBy 字段 --- internal/service/sys_deploy_file_service.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/service/sys_deploy_file_service.go b/internal/service/sys_deploy_file_service.go index ae484ba..0df77d0 100644 --- a/internal/service/sys_deploy_file_service.go +++ b/internal/service/sys_deploy_file_service.go @@ -111,9 +111,7 @@ func (s *SysDeployFileService) UpdateByID(c *gin.Context) serializer.Response { deployFile.UpdateTime = &now // 获取当前用户 - if updateBy := currentUserId; updateBy != "" { - deployFile.UpdateBy = updateBy - } + deployFile.UpdateBy = currentUserId if err := s.Db.Model(&deployFile).Where("deploy_id = ? AND del_flag = ? AND create_by = ?", id, "0", currentUserId).Updates(&deployFile).Error; err != nil { logger.Error(c, "更新部署文件记录失败!")