mirror of https://gitee.com/topiam/eiam
✨ 优化
parent
4f82b72b53
commit
cf101c8e4c
|
@ -1,3 +1,21 @@
|
||||||
|
#
|
||||||
|
# TopIAM Employee - Employee Identity and Access Management
|
||||||
|
# Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import cn.topiam.employee.support.security.util.SecurityUtils;
|
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
@ -55,6 +54,7 @@ import cn.topiam.employee.support.context.ApplicationContextHelp;
|
||||||
import cn.topiam.employee.support.repository.page.domain.Page;
|
import cn.topiam.employee.support.repository.page.domain.Page;
|
||||||
import cn.topiam.employee.support.repository.page.domain.PageModel;
|
import cn.topiam.employee.support.repository.page.domain.PageModel;
|
||||||
import cn.topiam.employee.support.security.userdetails.UserType;
|
import cn.topiam.employee.support.security.userdetails.UserType;
|
||||||
|
import cn.topiam.employee.support.security.util.SecurityUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审计数据转换
|
* 审计数据转换
|
||||||
|
@ -187,7 +187,8 @@ public interface AuditDataConverter {
|
||||||
}
|
}
|
||||||
// 登录角色 管理员
|
// 登录角色 管理员
|
||||||
if (UserType.USER.equals(userType)) {
|
if (UserType.USER.equals(userType)) {
|
||||||
predicate = ExpressionUtils.and(predicate, auditEntity.actorId.eq(SecurityUtils.getCurrentUser().getId()));
|
predicate = ExpressionUtils.and(predicate,
|
||||||
|
auditEntity.actorId.eq(SecurityUtils.getCurrentUser().getId()));
|
||||||
// 用户类型
|
// 用户类型
|
||||||
predicate = ExpressionUtils.and(predicate, auditEntity.actorType.eq(UserType.USER));
|
predicate = ExpressionUtils.and(predicate, auditEntity.actorType.eq(UserType.USER));
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,9 +140,13 @@ const AppBasic = (props: { app: GetApp }) => {
|
||||||
label={intl.formatMessage({ id: 'pages.app.config.detail.config.icon' })}
|
label={intl.formatMessage({ id: 'pages.app.config.detail.config.icon' })}
|
||||||
extra={
|
extra={
|
||||||
<div style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
|
<div style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
|
||||||
<span>{intl.formatMessage({ id: 'pages.app.config.detail.config.icon.desc.1' })}</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'pages.app.config.detail.config.icon.desc.1' })}
|
||||||
|
</span>
|
||||||
<br />
|
<br />
|
||||||
<span>{intl.formatMessage({ id: 'pages.app.config.detail.config.icon.desc.2' })}</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'pages.app.config.detail.config.icon.desc.2' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
@ -21,7 +21,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import cn.topiam.employee.authentication.wechat.WeChatIdpScanCodeConfig;
|
|
||||||
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.Mapping;
|
import org.mapstruct.Mapping;
|
||||||
|
@ -44,6 +43,7 @@ import cn.topiam.employee.authentication.feishu.FeiShuIdpScanCodeConfig;
|
||||||
import cn.topiam.employee.authentication.gitee.GiteeIdpOAuth2Config;
|
import cn.topiam.employee.authentication.gitee.GiteeIdpOAuth2Config;
|
||||||
import cn.topiam.employee.authentication.github.GithubIdpOauthConfig;
|
import cn.topiam.employee.authentication.github.GithubIdpOauthConfig;
|
||||||
import cn.topiam.employee.authentication.qq.QqIdpOauthConfig;
|
import cn.topiam.employee.authentication.qq.QqIdpOauthConfig;
|
||||||
|
import cn.topiam.employee.authentication.wechat.WeChatIdpScanCodeConfig;
|
||||||
import cn.topiam.employee.authentication.wechatwork.WeChatWorkIdpScanCodeConfig;
|
import cn.topiam.employee.authentication.wechatwork.WeChatWorkIdpScanCodeConfig;
|
||||||
import cn.topiam.employee.common.entity.authn.IdentityProviderEntity;
|
import cn.topiam.employee.common.entity.authn.IdentityProviderEntity;
|
||||||
import cn.topiam.employee.common.entity.authn.QIdentityProviderEntity;
|
import cn.topiam.employee.common.entity.authn.QIdentityProviderEntity;
|
||||||
|
|
|
@ -20,7 +20,6 @@ package cn.topiam.employee.console.synchronizer.configuration;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import cn.topiam.employee.support.context.ApplicationContextHelp;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
|
@ -66,11 +65,11 @@ import cn.topiam.employee.identitysource.feishu.client.FeiShuClient;
|
||||||
import cn.topiam.employee.identitysource.wechatwork.WeChatWorkConfig;
|
import cn.topiam.employee.identitysource.wechatwork.WeChatWorkConfig;
|
||||||
import cn.topiam.employee.identitysource.wechatwork.WeChatWorkIdentitySource;
|
import cn.topiam.employee.identitysource.wechatwork.WeChatWorkIdentitySource;
|
||||||
import cn.topiam.employee.identitysource.wechatwork.client.WeChatWorkClient;
|
import cn.topiam.employee.identitysource.wechatwork.client.WeChatWorkClient;
|
||||||
|
import cn.topiam.employee.support.context.ApplicationContextHelp;
|
||||||
import cn.topiam.employee.support.scheduler.SpringSchedulerRegister;
|
import cn.topiam.employee.support.scheduler.SpringSchedulerRegister;
|
||||||
import cn.topiam.employee.support.trace.TraceUtils;
|
import cn.topiam.employee.support.trace.TraceUtils;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static cn.topiam.employee.common.enums.identitysource.IdentitySourceProvider.DINGTALK;
|
import static cn.topiam.employee.common.enums.identitysource.IdentitySourceProvider.DINGTALK;
|
||||||
import static cn.topiam.employee.support.lock.LockAspect.getTopiamLockKeyPrefix;
|
import static cn.topiam.employee.support.lock.LockAspect.getTopiamLockKeyPrefix;
|
||||||
|
|
||||||
|
|
|
@ -122,9 +122,9 @@ public class ClusterSessionRegistryImpl<T extends org.springframework.session.Se
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static Session getSession(MapSession session, UserDetails userDetails, Authentication authentication) {
|
private static Session getSession(MapSession session, UserDetails userDetails,
|
||||||
WebAuthenticationDetails details = (WebAuthenticationDetails) authentication
|
Authentication authentication) {
|
||||||
.getDetails();
|
WebAuthenticationDetails details = (WebAuthenticationDetails) authentication.getDetails();
|
||||||
Session sessionDetails = new Session(userDetails.getId(), userDetails.getUsername());
|
Session sessionDetails = new Session(userDetails.getId(), userDetails.getUsername());
|
||||||
//last request
|
//last request
|
||||||
Instant instant = session.getLastAccessedTime();
|
Instant instant = session.getLastAccessedTime();
|
||||||
|
@ -135,8 +135,7 @@ public class ClusterSessionRegistryImpl<T extends org.springframework.session.Se
|
||||||
//登录时间
|
//登录时间
|
||||||
sessionDetails.setAuthenticationTime(details.getAuthenticationTime());
|
sessionDetails.setAuthenticationTime(details.getAuthenticationTime());
|
||||||
//登录时间
|
//登录时间
|
||||||
sessionDetails
|
sessionDetails.setAuthenticationProvider(details.getAuthenticationProvider().getType());
|
||||||
.setAuthenticationProvider(details.getAuthenticationProvider().getType());
|
|
||||||
//用户类型
|
//用户类型
|
||||||
sessionDetails.setUserType(userDetails.getUserType());
|
sessionDetails.setUserType(userDetails.getUserType());
|
||||||
//地理位置
|
//地理位置
|
||||||
|
|
|
@ -1,5 +1,26 @@
|
||||||
|
/*
|
||||||
|
* eiam-openapi - Employee Identity and Access Management
|
||||||
|
* Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package cn.topiam.employee.openapi.endpoint.app;
|
package cn.topiam.employee.openapi.endpoint.app;
|
||||||
|
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import cn.topiam.employee.audit.annotation.Audit;
|
import cn.topiam.employee.audit.annotation.Audit;
|
||||||
import cn.topiam.employee.audit.event.type.EventType;
|
import cn.topiam.employee.audit.event.type.EventType;
|
||||||
import cn.topiam.employee.common.entity.app.query.AppAccountQuery;
|
import cn.topiam.employee.common.entity.app.query.AppAccountQuery;
|
||||||
|
@ -11,13 +32,11 @@ import cn.topiam.employee.support.lock.Lock;
|
||||||
import cn.topiam.employee.support.preview.Preview;
|
import cn.topiam.employee.support.preview.Preview;
|
||||||
import cn.topiam.employee.support.repository.page.domain.Page;
|
import cn.topiam.employee.support.repository.page.domain.Page;
|
||||||
import cn.topiam.employee.support.repository.page.domain.PageModel;
|
import cn.topiam.employee.support.repository.page.domain.PageModel;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import static cn.topiam.employee.openapi.constant.OpenApiV1Constants.APP_ACCOUNT_PATH;
|
import static cn.topiam.employee.openapi.constant.OpenApiV1Constants.APP_ACCOUNT_PATH;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue