From 3bd07c74282f8f087b5af3cee83faaee30d58003 Mon Sep 17 00:00:00 2001 From: ddmte32 Date: Mon, 23 Jun 2025 16:43:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E4=BB=A3=E7=A0=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DevEnvironmentServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java index 368f8f4b..82c270ae 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.platform.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.domain.CodeConfig; @@ -204,20 +206,22 @@ public class DevEnvironmentServiceImpl implements DevEnvironmentService { * @return */ private void cloneCodePath(Map codeMap) { - CodeConfig codeConfig = BeanUtil.copyProperties(codeMap, CodeConfig.class); + if (CollectionUtil.isEmpty(codeMap)) { + return; + } LoginUser loginUser = SecurityUtils.getLoginUser(); String gitLinkUsername = loginUser.getSysUser().getUserName(); - String ci4sUsername = Boolean.TRUE.equals(codeConfig.getIsPublic()) ? Constant.Item_Public : loginUser.getUsername(); + String ci4sUsername = Boolean.TRUE.equals(codeMap.get("is_public")) ? Constant.Item_Public : loginUser.getUsername(); String gitLinkPassword = decrypt(loginUser.getSysUser().getOriginPassword()); String repositoryName = ci4sUsername + "_code_" + DateUtils.dateTimeNow(); - String relatePath = ci4sUsername + "/code/" + repositoryName + "/" + codeConfig.getGitBranch(); + String relatePath = ci4sUsername + "/code/" + repositoryName + "/" + codeMap.get("branch"); String localPath = localPathlocal + relatePath; try { - dvcUtils.gitClone(localPath, codeConfig.getGitUrl(), codeConfig.getGitBranch(), gitLinkUsername, gitLinkPassword); + dvcUtils.gitClone(localPath, StrUtil.toString(codeMap.get(" code_path")), StrUtil.toString(codeMap.get(" branch")), gitLinkUsername, gitLinkPassword); } catch (Exception e) { - log.error("[returnCodeConfig error,e={},codeConfigId={}]", e.getMessage(), codeConfig.getId()); + log.error("[returnCodeConfig error,e={},codeConfigId={}]", e.getMessage(), codeMap.get("id")); } codeMap.put("path", localPath); }