Explorar el Código

对 AppConfigDto#appRepo 字段进行检查, 不能包含空白字符

reghao hace 8 meses
padre
commit
0580aa478b

+ 5 - 0
mgr/src/main/java/cn/reghao/devops/mgr/app/service/impl/AppBuildServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -64,6 +65,10 @@ public class AppBuildServiceImpl implements AppBuildService {
             return Result.result(ResultStatus.FAIL, msg);
         }
 
+        String appRepo = appConfigDto.getAppRepo();
+        String appRepo1 = StringUtils.trimAllWhitespace(appRepo);
+        appConfigDto.setAppRepo(appRepo1);
+
         String repoAuthName = appConfigDto.getRepoAuthConfig();
         String compilerName = appConfigDto.getCompilerConfig();
         String packerName = appConfigDto.getPackerConfig();