fix(项目设置): 模板字段长度过长提示问题

--bug=1047708 --user=宋昌昌 【项目设置】编辑缺陷模版-缺陷内容上传链接图片-更新失败-报SQL异常 https://www.tapd.cn/55049933/s/1596880
This commit is contained in:
song-cc-rock 2024-10-23 18:57:13 +08:00 committed by Craftsman
parent e0a11da813
commit d360e3e912
4 changed files with 16 additions and 1 deletions

View File

@ -144,7 +144,7 @@ public class ApiDocShareController {
@GetMapping(value = "/get-detail/{id}") @GetMapping(value = "/get-detail/{id}")
@Operation(summary = "接口测试-接口管理-获取接口详情") @Operation(summary = "接口测试-接口管理-获取接口详情")
public ApiDefinitionDTO get(@PathVariable String id) { public ApiDefinitionDTO get(@PathVariable String id) {
return apiDefinitionService.get(id, SessionUtils.getUserId()); return apiDefinitionService.get(id, "admin");
} }
} }

View File

@ -445,6 +445,19 @@
try { try {
loading.value = true; loading.value = true;
const params = getTemplateParams(); const params = getTemplateParams();
let isSysErr = false;
if (params.systemFields) {
params.systemFields.forEach((item) => {
if (item.fieldId === 'description' && item.defaultValue && item.defaultValue.length > 1500) {
Message.error(t('system.orgTemplate.description.too.long'));
isSysErr = true;
}
});
}
if (isSysErr) {
// ,
return;
}
if (!templateForm.value.name) { if (!templateForm.value.name) {
isError.value = true; isError.value = true;
Message.error(t('system.orgTemplate.templateNamePlaceholder')); Message.error(t('system.orgTemplate.templateNamePlaceholder'));

View File

@ -77,6 +77,7 @@ export default {
'system.orgTemplate.templatePreview': 'Template preview', 'system.orgTemplate.templatePreview': 'Template preview',
'system.orgTemplate.templateName': 'Template name', 'system.orgTemplate.templateName': 'Template name',
'system.orgTemplate.templateNamePlaceholder': 'Please enter a template name', 'system.orgTemplate.templateNamePlaceholder': 'Please enter a template name',
'system.orgTemplate.description.too.long': 'The default length of defect content is more than 1500!',
'system.orgTemplate.optionalField': 'Optional Field', 'system.orgTemplate.optionalField': 'Optional Field',
'system.orgTemplate.selectAll': 'select All', 'system.orgTemplate.selectAll': 'select All',
'system.orgTemplate.systemField': 'System Field', 'system.orgTemplate.systemField': 'System Field',

View File

@ -76,6 +76,7 @@ export default {
'system.orgTemplate.templatePreview': '模板预览', 'system.orgTemplate.templatePreview': '模板预览',
'system.orgTemplate.templateName': '模板名称', 'system.orgTemplate.templateName': '模板名称',
'system.orgTemplate.templateNamePlaceholder': '请输入模板名称', 'system.orgTemplate.templateNamePlaceholder': '请输入模板名称',
'system.orgTemplate.description.too.long': '缺陷内容默认值长度超过1500!',
'system.orgTemplate.optionalField': '可选字段', 'system.orgTemplate.optionalField': '可选字段',
'system.orgTemplate.selectAll': '全选', 'system.orgTemplate.selectAll': '全选',
'system.orgTemplate.systemField': '系统字段', 'system.orgTemplate.systemField': '系统字段',