From c2a9911138ddd7a78c46206a7e0bfa64f476ba62 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 5 Jul 2021 17:05:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20jira=E7=94=A8=E6=88=B7=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/service/ProjectService.java | 4 ++-- .../io/metersphere/track/issue/client/JiraAbstractClient.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/ProjectService.java b/backend/src/main/java/io/metersphere/service/ProjectService.java index 54bb3e5715..6758474fbc 100644 --- a/backend/src/main/java/io/metersphere/service/ProjectService.java +++ b/backend/src/main/java/io/metersphere/service/ProjectService.java @@ -111,7 +111,7 @@ public class ProjectService { // 创建项目为当前用户添加用户组 UserGroup userGroup = new UserGroup(); userGroup.setId(UUID.randomUUID().toString()); - userGroup.setUserId(project.getCreateUser()); + userGroup.setUserId(SessionUtils.getUserId()); userGroup.setCreateTime(System.currentTimeMillis()); userGroup.setUpdateTime(System.currentTimeMillis()); userGroup.setGroupId(UserGroupConstants.PROJECT_ADMIN); @@ -119,7 +119,7 @@ public class ProjectService { userGroupMapper.insert(userGroup); // 创建新项目检查当前用户 last_project_id - extUserMapper.updateLastProjectIdIfNull(project.getId(), project.getCreateUser()); + extUserMapper.updateLastProjectIdIfNull(project.getId(), SessionUtils.getUserId()); return project; } diff --git a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java index 55233f885c..8d7ed6d61a 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java @@ -51,7 +51,7 @@ public abstract class JiraAbstractClient extends BaseClient { public void auth() { try { - restTemplate.exchange(getBaseUrl() + "/permissions", HttpMethod.GET, getAuthHttpEntity(), String.class); + restTemplate.exchange(getBaseUrl() + "/myself", HttpMethod.GET, getAuthHttpEntity(), String.class); } catch (Exception e) { LogUtil.error(e.getMessage(), e); MSException.throwException(e.getMessage());