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());