fix: jira用户校验权限报错
This commit is contained in:
parent
9a793107c8
commit
c2a9911138
|
@ -111,7 +111,7 @@ public class ProjectService {
|
||||||
// 创建项目为当前用户添加用户组
|
// 创建项目为当前用户添加用户组
|
||||||
UserGroup userGroup = new UserGroup();
|
UserGroup userGroup = new UserGroup();
|
||||||
userGroup.setId(UUID.randomUUID().toString());
|
userGroup.setId(UUID.randomUUID().toString());
|
||||||
userGroup.setUserId(project.getCreateUser());
|
userGroup.setUserId(SessionUtils.getUserId());
|
||||||
userGroup.setCreateTime(System.currentTimeMillis());
|
userGroup.setCreateTime(System.currentTimeMillis());
|
||||||
userGroup.setUpdateTime(System.currentTimeMillis());
|
userGroup.setUpdateTime(System.currentTimeMillis());
|
||||||
userGroup.setGroupId(UserGroupConstants.PROJECT_ADMIN);
|
userGroup.setGroupId(UserGroupConstants.PROJECT_ADMIN);
|
||||||
|
@ -119,7 +119,7 @@ public class ProjectService {
|
||||||
userGroupMapper.insert(userGroup);
|
userGroupMapper.insert(userGroup);
|
||||||
|
|
||||||
// 创建新项目检查当前用户 last_project_id
|
// 创建新项目检查当前用户 last_project_id
|
||||||
extUserMapper.updateLastProjectIdIfNull(project.getId(), project.getCreateUser());
|
extUserMapper.updateLastProjectIdIfNull(project.getId(), SessionUtils.getUserId());
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public abstract class JiraAbstractClient extends BaseClient {
|
||||||
|
|
||||||
public void auth() {
|
public void auth() {
|
||||||
try {
|
try {
|
||||||
restTemplate.exchange(getBaseUrl() + "/permissions", HttpMethod.GET, getAuthHttpEntity(), String.class);
|
restTemplate.exchange(getBaseUrl() + "/myself", HttpMethod.GET, getAuthHttpEntity(), String.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.error(e.getMessage(), e);
|
LogUtil.error(e.getMessage(), e);
|
||||||
MSException.throwException(e.getMessage());
|
MSException.throwException(e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue