fix(项目设置): 修复文件库文件pull的时候如果文件不存在前台没有报错提示的问题
--bug=1017069 --user=宋天阳 【项目设置】文件管理-PULL文件-git仓库被删除-PULL成功 https://www.tapd.cn/55049933/s/1248383
This commit is contained in:
parent
d64251d44d
commit
b037e175e2
|
@ -302,14 +302,16 @@ public class FileMetadataService {
|
|||
|
||||
|
||||
private void checkName(FileMetadata fileMetadata) {
|
||||
FileMetadataExample example = new FileMetadataExample();
|
||||
FileMetadataExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andNameEqualTo(fileMetadata.getName())
|
||||
.andProjectIdEqualTo(fileMetadata.getProjectId())
|
||||
.andIdNotEqualTo(fileMetadata.getId());
|
||||
|
||||
if (fileMetadataMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("project_file_already_exists"));
|
||||
//文件库的名字不用判断是否唯一.是根据文件库路径自动解析生成的。
|
||||
if (!StringUtils.equals(StorageConstants.GIT.name(), fileMetadata.getStorage())) {
|
||||
FileMetadataExample example = new FileMetadataExample();
|
||||
FileMetadataExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andNameEqualTo(fileMetadata.getName())
|
||||
.andProjectIdEqualTo(fileMetadata.getProjectId())
|
||||
.andIdNotEqualTo(fileMetadata.getId());
|
||||
if (fileMetadataMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("project_file_already_exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,7 @@ public class GitRepositoryUtils {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("获取文件库文件报错!", e);
|
||||
MSException.throwException("Connect repository error!");
|
||||
} finally {
|
||||
this.closeConnection(repo);
|
||||
}
|
||||
|
|
|
@ -41,13 +41,6 @@
|
|||
<el-main>
|
||||
<el-form :model="data" :rules="rules" label-position="right" label-width="80px" size="small" ref="form">
|
||||
<!-- 基础信息 -->
|
||||
<el-form-item :label="$t('commons.description')" prop="description">
|
||||
<el-input class="ms-http-textarea"
|
||||
v-model="data.description"
|
||||
type="textarea"
|
||||
:rows="2" size="small" @blur="save"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('load_test.file_name')" prop="name">
|
||||
<el-input
|
||||
class="ms-file-item-input"
|
||||
|
@ -56,11 +49,15 @@
|
|||
:disabled="isRepositoryFile()"
|
||||
show-word-limit @blur="save"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('commons.description')" prop="description">
|
||||
<el-input class="ms-http-textarea"
|
||||
v-model="data.description"
|
||||
type="textarea"
|
||||
:rows="2" size="small" @blur="save"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('load_test.file_type')" prop="type">
|
||||
<span>{{ data.type }}</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('load_test.file_size')" prop="size">
|
||||
<span>{{ formatFileSize(data.size) }}</span>
|
||||
</el-form-item>
|
||||
|
|
Loading…
Reference in New Issue