From 078f24d86b0c1a7303f926ed077763d867f4ef68 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 22 Dec 2022 16:00:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=A4=84=E7=90=86json=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../java/io/metersphere/sechedule/SwaggerUrlImportJob.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/sechedule/SwaggerUrlImportJob.java b/api-test/backend/src/main/java/io/metersphere/sechedule/SwaggerUrlImportJob.java index abaae59881..f6e6dac02b 100644 --- a/api-test/backend/src/main/java/io/metersphere/sechedule/SwaggerUrlImportJob.java +++ b/api-test/backend/src/main/java/io/metersphere/sechedule/SwaggerUrlImportJob.java @@ -43,7 +43,6 @@ public class SwaggerUrlImportJob extends MsScheduleJob { request.setPlatform("Swagger2"); request.setUserId(jobDataMap.getString("userId")); request.setType("schedule"); - request.setUserId(jobDataMap.getString("userId")); request.setResourceId(resourceId); apiDefinitionService.apiTestImport(null, request); } @@ -59,7 +58,7 @@ public class SwaggerUrlImportJob extends MsScheduleJob { public void setAuthInfo(String config, ApiTestImportRequest request) { // 获取鉴权设置 if (StringUtils.isNotBlank(config)) { - JSONObject configObj = JSON.parseObject(config, JSONObject.class); + JSONObject configObj = JSONUtil.parseObject(config); List headers = JSONUtil.parseArray(configObj.optString("headers"), KeyValue.class); if (CollectionUtils.isNotEmpty(headers)) { request.setHeaders(headers);