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': '系统字段',