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