From d360e3e9123a356cc64a41ada85a3e6e522156ea Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 23 Oct 2024 18:57:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AD=97=E6=AE=B5=E9=95=BF=E5=BA=A6=E8=BF=87?= =?UTF-8?q?=E9=95=BF=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047708 --user=宋昌昌 【项目设置】编辑缺陷模版-缺陷内容上传链接图片-更新失败-报SQL异常 https://www.tapd.cn/55049933/s/1596880 --- .../definition/ApiDocShareController.java | 2 +- .../template/components/addTemplate.vue | 13 +++++++++++++ .../setting/organization/template/locale/en-US.ts | 1 + .../setting/organization/template/locale/zh-CN.ts | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java index d033ef5dd6..dfe782cf2c 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java @@ -144,7 +144,7 @@ public class ApiDocShareController { @GetMapping(value = "/get-detail/{id}") @Operation(summary = "接口测试-接口管理-获取接口详情") public ApiDefinitionDTO get(@PathVariable String id) { - return apiDefinitionService.get(id, SessionUtils.getUserId()); + return apiDefinitionService.get(id, "admin"); } } diff --git a/frontend/src/views/setting/organization/template/components/addTemplate.vue b/frontend/src/views/setting/organization/template/components/addTemplate.vue index 5f8710f0d5..c513c9aa84 100644 --- a/frontend/src/views/setting/organization/template/components/addTemplate.vue +++ b/frontend/src/views/setting/organization/template/components/addTemplate.vue @@ -445,6 +445,19 @@ try { loading.value = true; 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) { isError.value = true; Message.error(t('system.orgTemplate.templateNamePlaceholder')); diff --git a/frontend/src/views/setting/organization/template/locale/en-US.ts b/frontend/src/views/setting/organization/template/locale/en-US.ts index fcaa55b849..316dc3f578 100644 --- a/frontend/src/views/setting/organization/template/locale/en-US.ts +++ b/frontend/src/views/setting/organization/template/locale/en-US.ts @@ -77,6 +77,7 @@ export default { 'system.orgTemplate.templatePreview': 'Template preview', 'system.orgTemplate.templateName': '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.selectAll': 'select All', 'system.orgTemplate.systemField': 'System Field', diff --git a/frontend/src/views/setting/organization/template/locale/zh-CN.ts b/frontend/src/views/setting/organization/template/locale/zh-CN.ts index 9edb0d2feb..d61fb586c1 100644 --- a/frontend/src/views/setting/organization/template/locale/zh-CN.ts +++ b/frontend/src/views/setting/organization/template/locale/zh-CN.ts @@ -76,6 +76,7 @@ export default { 'system.orgTemplate.templatePreview': '模板预览', 'system.orgTemplate.templateName': '模板名称', 'system.orgTemplate.templateNamePlaceholder': '请输入模板名称', + 'system.orgTemplate.description.too.long': '缺陷内容默认值长度超过1500!', 'system.orgTemplate.optionalField': '可选字段', 'system.orgTemplate.selectAll': '全选', 'system.orgTemplate.systemField': '系统字段',