Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
b7e2939d
Commit
b7e2939d
authored
Jun 14, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
42bf9879
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
54 additions
and
38 deletions
+54
-38
AuthorizationServerConfiguration.java
...v1/yifu/auth/config/AuthorizationServerConfiguration.java
+1
-1
GatewayConfigProperties.java
...oud.plus.v1/yifu/auth/config/GatewayConfigProperties.java
+0
-4
YifuAuthenticationFailureEventHandler.java
...u/auth/handler/YifuAuthenticationFailureEventHandler.java
+1
-1
YifuAuthenticationSuccessEventHandler.java
...u/auth/handler/YifuAuthenticationSuccessEventHandler.java
+1
-1
YifuClientLoginSuccessHandler.java
...s.v1/yifu/auth/handler/YifuClientLoginSuccessHandler.java
+1
-1
pom.xml
yifu-common/yifu-common-core/pom.xml
+4
-0
YifuUser.java
.../com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
+3
-4
XxlJobAutoConfiguration.java
...loud.plus.v1/yifu/common/job/XxlJobAutoConfiguration.java
+1
-1
LogAutoConfiguration.java
...u.cloud.plus.v1/yifu/common/log/LogAutoConfiguration.java
+0
-1
SysLogListener.java
...u.cloud.plus.v1/yifu/common/log/event/SysLogListener.java
+0
-3
SysLogUtils.java
.../yifu.cloud.plus.v1/yifu/common/log/util/SysLogUtils.java
+0
-1
pom.xml
yifu-common/yifu-common-mybatis/pom.xml
+5
-1
MybatisPlusMetaObjectHandler.java
...u/common/mybatis/config/MybatisPlusMetaObjectHandler.java
+27
-3
YifuLocalResourceServerTokenServices.java
...urity/component/YifuLocalResourceServerTokenServices.java
+1
-1
YifuAppUserDetailsServiceImpl.java
...ommon/security/service/YifuAppUserDetailsServiceImpl.java
+1
-0
YifuUserDetailsService.java
.../yifu/common/security/service/YifuUserDetailsService.java
+1
-0
YifuUserDetailsServiceImpl.java
...u/common/security/service/YifuUserDetailsServiceImpl.java
+1
-0
SecurityUtils.java
...loud.plus.v1/yifu/common/security/util/SecurityUtils.java
+1
-1
UserAndToke.java
...fu/cloud/plus/v1/yifu/common/security/vo/UserAndToke.java
+1
-1
SysRole.java
...com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysRole.java
+0
-1
SysDataAuthService.java
....cloud.plus.v1/yifu/admin/service/SysDataAuthService.java
+0
-1
SysDataAuthServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDataAuthServiceImpl.java
+1
-1
AuthController.java
...aba/csp/sentinel/dashboard/controller/AuthController.java
+3
-10
No files found.
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/config/AuthorizationServerConfiguration.java
View file @
b7e2939d
...
@@ -17,11 +17,11 @@
...
@@ -17,11 +17,11 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuWebResponseExceptionTranslator
;
import
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuWebResponseExceptionTranslator
;
import
com.yifu.cloud.plus.v1.yifu.common.security.grant.ResourceOwnerCustomAppTokenGranter
;
import
com.yifu.cloud.plus.v1.yifu.common.security.grant.ResourceOwnerCustomAppTokenGranter
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuClientDetailsService
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuClientDetailsService
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuCustomTokenServices
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuCustomTokenServices
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
...
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/config/GatewayConfigProperties.java
View file @
b7e2939d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
/**
* @author lengleng
* @author lengleng
...
...
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/handler/YifuAuthenticationFailureEventHandler.java
View file @
b7e2939d
...
@@ -19,11 +19,11 @@ package com.yifu.cloud.plus.v1.yifu.auth.handler;
...
@@ -19,11 +19,11 @@ package com.yifu.cloud.plus.v1.yifu.auth.handler;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.LogTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.LogTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationFailureEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationFailureEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
...
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/handler/YifuAuthenticationSuccessEventHandler.java
View file @
b7e2939d
...
@@ -19,10 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.auth.handler;
...
@@ -19,10 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.auth.handler;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationSuccessEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationSuccessEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
...
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/handler/YifuClientLoginSuccessHandler.java
View file @
b7e2939d
...
@@ -9,8 +9,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...
@@ -9,8 +9,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.WebUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.WebUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.exception.InvalidException
;
import
com.yifu.cloud.plus.v1.yifu.common.security.exception.InvalidException
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.AuthUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.AuthUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.vo.UserAndToke
;
import
com.yifu.cloud.plus.v1.yifu.common.security.vo.UserAndToke
;
import
lombok.Builder
;
import
lombok.Builder
;
...
...
yifu-common/yifu-common-core/pom.xml
View file @
b7e2939d
...
@@ -62,6 +62,10 @@
...
@@ -62,6 +62,10 @@
<artifactId>
spring-webmvc
</artifactId>
<artifactId>
spring-webmvc
</artifactId>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-core
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
yifu-common/yifu-common-
security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service
/YifuUser.java
→
yifu-common/yifu-common-
core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo
/YifuUser.java
View file @
b7e2939d
...
@@ -14,9 +14,8 @@
...
@@ -14,9 +14,8 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
service
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Getter
;
import
lombok.Getter
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.security.core.userdetails.User
;
...
@@ -54,8 +53,8 @@ public class YifuUser extends User {
...
@@ -54,8 +53,8 @@ public class YifuUser extends User {
private
final
String
phone
;
private
final
String
phone
;
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
password
,
String
phone
,
boolean
enabled
,
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
password
,
String
phone
,
boolean
enabled
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
Collection
<?
extends
GrantedAuthority
>
authorities
)
{
Collection
<?
extends
GrantedAuthority
>
authorities
)
{
super
(
username
,
password
,
enabled
,
accountNonExpired
,
credentialsNonExpired
,
accountNonLocked
,
authorities
);
super
(
username
,
password
,
enabled
,
accountNonExpired
,
credentialsNonExpired
,
accountNonLocked
,
authorities
);
this
.
id
=
id
;
this
.
id
=
id
;
this
.
deptId
=
deptId
;
this
.
deptId
=
deptId
;
...
...
yifu-common/yifu-common-job/src/main/java/com/yifu.cloud.plus.v1/yifu/common/job/XxlJobAutoConfiguration.java
View file @
b7e2939d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
job
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
job
;
import
com.xxl.job.core.executor.impl.XxlJobSpringExecutor
;
import
com.yifu.cloud.plus.v1.yifu.common.job.properties.XxlExecutorProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.job.properties.XxlExecutorProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.job.properties.XxlJobProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.job.properties.XxlJobProperties
;
import
com.xxl.job.core.executor.impl.XxlJobSpringExecutor
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
...
...
yifu-common/yifu-common-log/src/main/java/com/yifu.cloud.plus.v1/yifu/common/log/LogAutoConfiguration.java
View file @
b7e2939d
...
@@ -21,7 +21,6 @@ import com.yifu.cloud.plus.v1.yifu.common.log.aspect.SysLogAspect;
...
@@ -21,7 +21,6 @@ import com.yifu.cloud.plus.v1.yifu.common.log.aspect.SysLogAspect;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogListener
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogListener
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
...
...
yifu-common/yifu-common-log/src/main/java/com/yifu.cloud.plus.v1/yifu/common/log/event/SysLogListener.java
View file @
b7e2939d
...
@@ -16,10 +16,8 @@
...
@@ -16,10 +16,8 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
log
.
event
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
log
.
event
;
import
com.alibaba.fastjson.JSON
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -28,7 +26,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
...
@@ -28,7 +26,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import
org.springframework.context.event.EventListener
;
import
org.springframework.context.event.EventListener
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.web.bind.annotation.RequestHeader
;
/**
/**
* @author lengleng 异步监听日志事件
* @author lengleng 异步监听日志事件
...
...
yifu-common/yifu-common-log/src/main/java/com/yifu.cloud.plus.v1/yifu/common/log/util/SysLogUtils.java
View file @
b7e2939d
...
@@ -20,7 +20,6 @@ import cn.hutool.core.util.URLUtil;
...
@@ -20,7 +20,6 @@ import cn.hutool.core.util.URLUtil;
import
cn.hutool.extra.servlet.ServletUtil
;
import
cn.hutool.extra.servlet.ServletUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.experimental.UtilityClass
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
...
...
yifu-common/yifu-common-mybatis/pom.xml
View file @
b7e2939d
...
@@ -73,5 +73,9 @@
...
@@ -73,5 +73,9 @@
<artifactId>
jackson-annotations
</artifactId>
<artifactId>
jackson-annotations
</artifactId>
<version>
2.13.2
</version>
<version>
2.13.2
</version>
</dependency>
</dependency>
</dependencies>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-core
</artifactId>
</dependency>
</dependencies>
</project>
</project>
yifu-common/yifu-common-mybatis/src/main/java/com/yifu.cloud.plus.v1/yifu/common/mybatis/config/MybatisPlusMetaObjectHandler.java
View file @
b7e2939d
...
@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.common.mybatis.config;
...
@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.common.mybatis.config;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
;
import
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.reflection.MetaObject
;
import
org.apache.ibatis.reflection.MetaObject
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
@@ -27,15 +29,22 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
...
@@ -27,15 +29,22 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
fillValIfNullByName
(
"createTime"
,
now
,
metaObject
,
false
);
fillValIfNullByName
(
"createTime"
,
now
,
metaObject
,
false
);
fillValIfNullByName
(
"updateTime"
,
now
,
metaObject
,
false
);
fillValIfNullByName
(
"updateTime"
,
now
,
metaObject
,
false
);
fillValIfNullByName
(
"createBy"
,
getUserName
(),
metaObject
,
false
);
YifuUser
yifuUser
=
getYifuUser
();
fillValIfNullByName
(
"updateBy"
,
getUserName
(),
metaObject
,
false
);
if
(
Common
.
isNotNull
(
yifuUser
)){
fillValIfNullByName
(
"createBy"
,
yifuUser
.
getId
(),
metaObject
,
false
);
fillValIfNullByName
(
"updateBy"
,
yifuUser
.
getId
(),
metaObject
,
false
);
fillValIfNullByName
(
"createName"
,
yifuUser
.
getNickname
(),
metaObject
,
false
);
}
}
}
@Override
@Override
public
void
updateFill
(
MetaObject
metaObject
)
{
public
void
updateFill
(
MetaObject
metaObject
)
{
log
.
debug
(
"mybatis plus start update fill ...."
);
log
.
debug
(
"mybatis plus start update fill ...."
);
fillValIfNullByName
(
"updateTime"
,
LocalDateTime
.
now
(),
metaObject
,
true
);
fillValIfNullByName
(
"updateTime"
,
LocalDateTime
.
now
(),
metaObject
,
true
);
fillValIfNullByName
(
"updateBy"
,
getUserName
(),
metaObject
,
true
);
YifuUser
yifuUser
=
getYifuUser
();
if
(
Common
.
isNotNull
(
yifuUser
)){
fillValIfNullByName
(
"updateBy"
,
yifuUser
.
getId
(),
metaObject
,
true
);
}
}
}
/**
/**
...
@@ -75,4 +84,19 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
...
@@ -75,4 +84,19 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
return
null
;
return
null
;
}
}
/**
* 获取 spring security 当前的用户
* @return 当前用户名
*/
private
YifuUser
getYifuUser
()
{
Authentication
authentication
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
if
(
authentication
==
null
)
{
return
null
;
}
Object
principal
=
authentication
.
getPrincipal
();
if
(
principal
instanceof
YifuUser
)
{
return
(
YifuUser
)
principal
;
}
return
null
;
}
}
}
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/component/YifuLocalResourceServerTokenServices.java
View file @
b7e2939d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
component
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
component
;
import
cn.hutool.extra.spring.SpringUtil
;
import
cn.hutool.extra.spring.SpringUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.exception.UnauthorizedException
;
import
com.yifu.cloud.plus.v1.yifu.common.security.exception.UnauthorizedException
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUserDetailsService
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUserDetailsService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuAppUserDetailsServiceImpl.java
View file @
b7e2939d
...
@@ -20,6 +20,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
...
@@ -20,6 +20,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUserDetailsService.java
View file @
b7e2939d
...
@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
...
@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.authority.AuthorityUtils
;
import
org.springframework.security.core.authority.AuthorityUtils
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUserDetailsServiceImpl.java
View file @
b7e2939d
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.service;
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.service;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/util/SecurityUtils.java
View file @
b7e2939d
...
@@ -18,7 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.util;
...
@@ -18,7 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.util;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.
security.service
.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.
core.vo
.YifuUser
;
import
lombok.experimental.UtilityClass
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.GrantedAuthority
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu/cloud/plus/v1/yifu/common/security/vo/UserAndToke.java
View file @
b7e2939d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
vo
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.common.
security.service
.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.
core.vo
.YifuUser
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
...
...
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysRole.java
View file @
b7e2939d
...
@@ -52,7 +52,6 @@ public class SysRole extends BaseEntity {
...
@@ -52,7 +52,6 @@ public class SysRole extends BaseEntity {
@Schema
(
description
=
"角色标识"
)
@Schema
(
description
=
"角色标识"
)
private
String
roleCode
;
private
String
roleCode
;
@NotBlank
(
message
=
"角色描述 不能为空"
)
@Schema
(
description
=
"角色描述"
)
@Schema
(
description
=
"角色描述"
)
private
String
roleDesc
;
private
String
roleDesc
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDataAuthService.java
View file @
b7e2939d
...
@@ -24,7 +24,6 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO;
...
@@ -24,7 +24,6 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeoutException
;
/**
/**
* @Description: 数据权限配置接口
* @Description: 数据权限配置接口
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDataAuthServiceImpl.java
View file @
b7e2939d
...
@@ -27,7 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...
@@ -27,7 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.
security.service
.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.
core.vo
.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.Cache
;
...
...
yifu-visual/yifu-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java
View file @
b7e2939d
...
@@ -15,15 +15,10 @@
...
@@ -15,15 +15,10 @@
*/
*/
package
com
.
alibaba
.
csp
.
sentinel
.
dashboard
.
controller
;
package
com
.
alibaba
.
csp
.
sentinel
.
dashboard
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.csp.sentinel.dashboard.auth.AuthService
;
import
com.alibaba.csp.sentinel.dashboard.auth.AuthService
;
import
com.alibaba.csp.sentinel.dashboard.auth.SimpleWebAuthServiceImpl
;
import
com.alibaba.csp.sentinel.dashboard.auth.SimpleWebAuthServiceImpl
;
import
com.alibaba.csp.sentinel.dashboard.config.DashboardConfig
;
import
com.alibaba.csp.sentinel.dashboard.config.DashboardConfig
;
import
com.alibaba.csp.sentinel.dashboard.domain.Result
;
import
com.alibaba.csp.sentinel.dashboard.domain.Result
;
import
com.google.common.net.HttpHeaders
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -32,13 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -32,13 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.security.authentication.event.LogoutSuccessEvent
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
import
org.springframework.security.oauth2.common.OAuth2RefreshToken
;
import
org.springframework.security.oauth2.provider.ClientDetailsService
;
import
org.springframework.security.oauth2.provider.ClientDetailsService
;
import
org.springframework.security.oauth2.provider.OAuth2Authentication
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment