Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8e4aadc6
由
sunke
编写于
2022-10-21 10:59:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
去除用户缓存,解决登陆语言问题
1 个父辈
f6f47470
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
13 行增加
和
125 行删除
src/main/java/com/neotel/smfcore/custom/hella/tcp/HellaTcpClient.java
src/main/java/com/neotel/smfcore/security/TokenConfigurer.java
src/main/java/com/neotel/smfcore/security/TokenFilter.java
src/main/java/com/neotel/smfcore/security/bean/LoginProperties.java
src/main/java/com/neotel/smfcore/security/config/SpringSecurityConfig.java
src/main/java/com/neotel/smfcore/security/rest/UserController.java
src/main/java/com/neotel/smfcore/security/rest/bean/dto/JwtUserDto.java
src/main/java/com/neotel/smfcore/security/service/UserCacheClean.java
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.java
src/main/resources/config/application-prod.yml
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/custom/hella/tcp/HellaTcpClient.java
查看文件 @
8e4aadc
...
@@ -34,16 +34,17 @@ public class HellaTcpClient {
...
@@ -34,16 +34,17 @@ public class HellaTcpClient {
private
static
NioSocketConnector
connector
;
private
static
NioSocketConnector
connector
;
private
static
String
host
=
""
;
private
static
String
host
=
""
;
private
static
int
port
=
9999
;
private
static
int
port
=
3333
;
private
static
String
configPort
=
""
;
@Value
(
"${hella.host:}"
)
@Value
(
"${hella.host:}"
)
public
void
setHost
(
String
host
)
{
public
void
setHost
(
String
host
)
{
HellaTcpClient
.
host
=
host
;
HellaTcpClient
.
host
=
host
;
}
}
@Value
(
"${hella.port:
9999
}"
)
@Value
(
"${hella.port:}"
)
public
void
setPort
(
int
p
ort
)
{
public
void
setPort
(
String
configP
ort
)
{
HellaTcpClient
.
port
=
p
ort
;
HellaTcpClient
.
configPort
=
configP
ort
;
}
}
@Autowired
@Autowired
...
@@ -58,7 +59,7 @@ public class HellaTcpClient {
...
@@ -58,7 +59,7 @@ public class HellaTcpClient {
@PostConstruct
@PostConstruct
public
void
init
(){
public
void
init
(){
host
=
dataCache
.
getConfigCache
(
"hella.host"
,
host
);
host
=
dataCache
.
getConfigCache
(
"hella.host"
,
host
);
port
=
Integer
.
parseInt
(
dataCache
.
getConfigCache
(
"hella.port"
,
port
+
""
))
;
port
=
Integer
.
parseInt
(
dataCache
.
getConfigCache
(
"hella.port"
,
configPort
))
;
if
(
ObjectUtil
.
isEmpty
(
host
)||
ObjectUtil
.
isEmpty
(
port
)){
if
(
ObjectUtil
.
isEmpty
(
host
)||
ObjectUtil
.
isEmpty
(
port
)){
log
.
info
(
"配置不完整,不需要连接"
);
log
.
info
(
"配置不完整,不需要连接"
);
}
else
{
}
else
{
...
...
src/main/java/com/neotel/smfcore/security/TokenConfigurer.java
查看文件 @
8e4aadc
...
@@ -17,7 +17,6 @@ package com.neotel.smfcore.security;
...
@@ -17,7 +17,6 @@ package com.neotel.smfcore.security;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.UserCacheClean
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.config.annotation.SecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.SecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
...
@@ -33,11 +32,10 @@ public class TokenConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFi
...
@@ -33,11 +32,10 @@ public class TokenConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFi
private
final
TokenProvider
tokenProvider
;
private
final
TokenProvider
tokenProvider
;
private
final
SecurityProperties
properties
;
private
final
SecurityProperties
properties
;
private
final
OnlineUserService
onlineUserService
;
private
final
OnlineUserService
onlineUserService
;
private
final
UserCacheClean
userCacheClean
;
@Override
@Override
public
void
configure
(
HttpSecurity
http
)
{
public
void
configure
(
HttpSecurity
http
)
{
TokenFilter
customFilter
=
new
TokenFilter
(
tokenProvider
,
properties
,
onlineUserService
,
userCacheClean
);
TokenFilter
customFilter
=
new
TokenFilter
(
tokenProvider
,
properties
,
onlineUserService
);
http
.
addFilterBefore
(
customFilter
,
UsernamePasswordAuthenticationFilter
.
class
);
http
.
addFilterBefore
(
customFilter
,
UsernamePasswordAuthenticationFilter
.
class
);
}
}
}
}
src/main/java/com/neotel/smfcore/security/TokenFilter.java
查看文件 @
8e4aadc
...
@@ -18,7 +18,6 @@ package com.neotel.smfcore.security;
...
@@ -18,7 +18,6 @@ package com.neotel.smfcore.security;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.UserCacheClean
;
import
com.neotel.smfcore.security.rest.bean.dto.OnlineUserDto
;
import
com.neotel.smfcore.security.rest.bean.dto.OnlineUserDto
;
import
io.jsonwebtoken.ExpiredJwtException
;
import
io.jsonwebtoken.ExpiredJwtException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -34,7 +33,6 @@ import javax.servlet.ServletRequest;
...
@@ -34,7 +33,6 @@ import javax.servlet.ServletRequest;
import
javax.servlet.ServletResponse
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Objects
;
/**
/**
* @author /
* @author /
...
@@ -46,19 +44,16 @@ public class TokenFilter extends GenericFilterBean {
...
@@ -46,19 +44,16 @@ public class TokenFilter extends GenericFilterBean {
private
final
TokenProvider
tokenProvider
;
private
final
TokenProvider
tokenProvider
;
private
final
SecurityProperties
properties
;
private
final
SecurityProperties
properties
;
private
final
OnlineUserService
onlineUserService
;
private
final
OnlineUserService
onlineUserService
;
private
final
UserCacheClean
userCacheClean
;
/**
/**
* @param tokenProvider Token
* @param tokenProvider Token
* @param properties JWT
* @param properties JWT
* @param onlineUserService 用户在线
* @param onlineUserService 用户在线
* @param userCacheClean 用户缓存清理工具
*/
*/
public
TokenFilter
(
TokenProvider
tokenProvider
,
SecurityProperties
properties
,
OnlineUserService
onlineUserService
,
UserCacheClean
userCacheClean
)
{
public
TokenFilter
(
TokenProvider
tokenProvider
,
SecurityProperties
properties
,
OnlineUserService
onlineUserService
)
{
this
.
properties
=
properties
;
this
.
properties
=
properties
;
this
.
onlineUserService
=
onlineUserService
;
this
.
onlineUserService
=
onlineUserService
;
this
.
tokenProvider
=
tokenProvider
;
this
.
tokenProvider
=
tokenProvider
;
this
.
userCacheClean
=
userCacheClean
;
}
}
@Override
@Override
...
@@ -69,16 +64,10 @@ public class TokenFilter extends GenericFilterBean {
...
@@ -69,16 +64,10 @@ public class TokenFilter extends GenericFilterBean {
// 对于 Token 为空的不需要去查 Redis
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
OnlineUserDto
onlineUserDto
=
null
;
boolean
cleanUserCache
=
false
;
try
{
try
{
onlineUserDto
=
onlineUserService
.
getOne
(
properties
.
getOnlineKey
()
+
token
);
onlineUserDto
=
onlineUserService
.
getOne
(
properties
.
getOnlineKey
()
+
token
);
}
catch
(
ExpiredJwtException
e
)
{
}
catch
(
ExpiredJwtException
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
cleanUserCache
=
true
;
}
finally
{
if
(
cleanUserCache
||
Objects
.
isNull
(
onlineUserDto
))
{
userCacheClean
.
cleanUserCache
(
String
.
valueOf
(
tokenProvider
.
getClaims
(
token
).
get
(
TokenProvider
.
AUTHORITIES_KEY
)));
}
}
}
if
(
onlineUserDto
!=
null
&&
StringUtils
.
hasText
(
token
))
{
if
(
onlineUserDto
!=
null
&&
StringUtils
.
hasText
(
token
))
{
Authentication
authentication
=
tokenProvider
.
getAuthentication
(
token
);
Authentication
authentication
=
tokenProvider
.
getAuthentication
(
token
);
...
...
src/main/java/com/neotel/smfcore/security/bean/LoginProperties.java
查看文件 @
8e4aadc
...
@@ -34,17 +34,8 @@ public class LoginProperties {
...
@@ -34,17 +34,8 @@ public class LoginProperties {
*/
*/
private
boolean
singleLogin
=
false
;
private
boolean
singleLogin
=
false
;
/**
* 用户登录信息缓存
*/
private
boolean
cacheEnable
;
public
boolean
isSingleLogin
()
{
public
boolean
isSingleLogin
()
{
return
singleLogin
;
return
singleLogin
;
}
}
public
boolean
isCacheEnable
()
{
return
cacheEnable
;
}
}
}
src/main/java/com/neotel/smfcore/security/config/SpringSecurityConfig.java
查看文件 @
8e4aadc
...
@@ -23,7 +23,6 @@ import com.neotel.smfcore.security.TokenConfigurer;
...
@@ -23,7 +23,6 @@ import com.neotel.smfcore.security.TokenConfigurer;
import
com.neotel.smfcore.security.TokenProvider
;
import
com.neotel.smfcore.security.TokenProvider
;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.bean.SecurityProperties
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.OnlineUserService
;
import
com.neotel.smfcore.security.service.UserCacheClean
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -38,9 +37,7 @@ import org.springframework.security.config.core.GrantedAuthorityDefaults;
...
@@ -38,9 +37,7 @@ import org.springframework.security.config.core.GrantedAuthorityDefaults;
import
org.springframework.security.config.http.SessionCreationPolicy
;
import
org.springframework.security.config.http.SessionCreationPolicy
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.filter.CorsFilter
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
...
@@ -60,7 +57,6 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -60,7 +57,6 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
private
final
ApplicationContext
applicationContext
;
private
final
ApplicationContext
applicationContext
;
private
final
SecurityProperties
properties
;
private
final
SecurityProperties
properties
;
private
final
OnlineUserService
onlineUserService
;
private
final
OnlineUserService
onlineUserService
;
private
final
UserCacheClean
userCacheClean
;
@Bean
@Bean
GrantedAuthorityDefaults
grantedAuthorityDefaults
()
{
GrantedAuthorityDefaults
grantedAuthorityDefaults
()
{
...
@@ -142,7 +138,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -142,7 +138,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
}
}
private
SecurityConfigurerAdapter
securityConfigurerAdapter
()
{
private
SecurityConfigurerAdapter
securityConfigurerAdapter
()
{
return
new
TokenConfigurer
(
tokenProvider
,
properties
,
onlineUserService
,
userCacheClean
);
return
new
TokenConfigurer
(
tokenProvider
,
properties
,
onlineUserService
);
}
}
private
Map
<
String
,
Set
<
String
>>
getAnonymousUrl
(
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
)
{
private
Map
<
String
,
Set
<
String
>>
getAnonymousUrl
(
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
)
{
...
...
src/main/java/com/neotel/smfcore/security/rest/UserController.java
查看文件 @
8e4aadc
...
@@ -15,24 +15,17 @@
...
@@ -15,24 +15,17 @@
*/
*/
package
com
.
neotel
.
smfcore
.
security
.
rest
;
package
com
.
neotel
.
smfcore
.
security
.
rest
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.annotation.QueryCondition
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.csv.CsvReader
;
import
com.neotel.smfcore.common.csv.CsvReader
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.*
;
import
com.neotel.smfcore.common.utils.*
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
com.neotel.smfcore.security.bean.RsaProperties
;
import
com.neotel.smfcore.security.bean.RsaProperties
;
import
com.neotel.smfcore.security.rest.bean.dto.RoleSmallDto
;
import
com.neotel.smfcore.security.rest.bean.dto.UserDto
;
import
com.neotel.smfcore.security.rest.bean.dto.UserDto
;
import
com.neotel.smfcore.security.rest.bean.mapstruct.UserMapper
;
import
com.neotel.smfcore.security.rest.bean.mapstruct.UserMapper
;
import
com.neotel.smfcore.security.rest.bean.query.UserQueryCriteria
;
import
com.neotel.smfcore.security.rest.bean.query.UserQueryCriteria
;
import
com.neotel.smfcore.security.rest.bean.vo.UserPassVo
;
import
com.neotel.smfcore.security.rest.bean.vo.UserPassVo
;
import
com.neotel.smfcore.security.service.UserCacheClean
;
import
com.neotel.smfcore.security.service.manager.IRoleManager
;
import
com.neotel.smfcore.security.service.manager.IUserManager
;
import
com.neotel.smfcore.security.service.manager.IUserManager
;
import
com.neotel.smfcore.security.service.po.User
;
import
com.neotel.smfcore.security.service.po.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -72,13 +65,9 @@ public class UserController {
...
@@ -72,13 +65,9 @@ public class UserController {
private
IUserManager
userManager
;
private
IUserManager
userManager
;
@Autowired
@Autowired
private
UserMapper
userMapper
;
private
UserMapper
userMapper
;
@Autowired
private
IRoleManager
roleManager
;
@Autowired
@Autowired
private
final
FileProperties
properties
;
private
final
FileProperties
properties
;
@Autowired
private
UserCacheClean
userCacheClean
;
@ApiOperation
(
"导出用户数据"
)
@ApiOperation
(
"导出用户数据"
)
@GetMapping
(
value
=
"/download"
)
@GetMapping
(
value
=
"/download"
)
...
@@ -165,7 +154,6 @@ public class UserController {
...
@@ -165,7 +154,6 @@ public class UserController {
log
.
info
(
"重置用户["
+
id
+
"]密码"
);
log
.
info
(
"重置用户["
+
id
+
"]密码"
);
User
resources
=
userManager
.
get
(
id
);
User
resources
=
userManager
.
get
(
id
);
userManager
.
updatePass
(
resources
.
getUsername
(),
passwordEncoder
.
encode
(
Constants
.
USER_DEFAULTP_PWD
));
userManager
.
updatePass
(
resources
.
getUsername
(),
passwordEncoder
.
encode
(
Constants
.
USER_DEFAULTP_PWD
));
userCacheClean
.
cleanUserCache
(
resources
.
getUsername
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"个人中心:获取个人资料"
)
@ApiOperation
(
"个人中心:获取个人资料"
)
...
@@ -203,7 +191,6 @@ public class UserController {
...
@@ -203,7 +191,6 @@ public class UserController {
throw
new
ValidateException
(
"smfcore.newPwdError"
,
"新密码不能与旧密码相同"
);
throw
new
ValidateException
(
"smfcore.newPwdError"
,
"新密码不能与旧密码相同"
);
}
}
userManager
.
updatePass
(
user
.
getUsername
(),
passwordEncoder
.
encode
(
newPass
));
userManager
.
updatePass
(
user
.
getUsername
(),
passwordEncoder
.
encode
(
newPass
));
userCacheClean
.
cleanUserCache
(
user
.
getUsername
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/security/rest/bean/dto/JwtUserDto.java
查看文件 @
8e4aadc
...
@@ -36,8 +36,6 @@ public class JwtUserDto implements UserDetails {
...
@@ -36,8 +36,6 @@ public class JwtUserDto implements UserDetails {
private
final
User
user
;
private
final
User
user
;
private
final
List
<
Long
>
dataScopes
;
@JSONField
(
serialize
=
false
)
@JSONField
(
serialize
=
false
)
private
final
List
<
GrantedAuthority
>
authorities
;
private
final
List
<
GrantedAuthority
>
authorities
;
...
...
src/main/java/com/neotel/smfcore/security/service/UserCacheClean.java
deleted
100644 → 0
查看文件 @
f6f4747
/*
* Copyright 2019-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
neotel
.
smfcore
.
security
.
service
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
org.springframework.stereotype.Component
;
/**
* @author: liaojinlong
* @date: 2020/6/11 18:01
* @apiNote: 用于清理 用户登录信息缓存,为防止Spring循环依赖与安全考虑 ,单独构成工具类
*/
@Component
public
class
UserCacheClean
{
/**
* 清理特定用户缓存信息<br>
* 用户信息变更时
*
* @param userName /
*/
public
void
cleanUserCache
(
String
userName
)
{
if
(
StringUtils
.
isNotEmpty
(
userName
))
{
UserDetailsServiceImpl
.
userDtoCache
.
remove
(
userName
);
}
}
/**
* 清理所有用户的缓存信息<br>
* ,如发生角色授权信息变化,可以简便的全部失效缓存
*/
public
void
cleanAll
()
{
UserDetailsServiceImpl
.
userDtoCache
.
clear
();
}
}
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.java
查看文件 @
8e4aadc
...
@@ -43,33 +43,13 @@ import java.util.stream.Collectors;
...
@@ -43,33 +43,13 @@ import java.util.stream.Collectors;
@Service
(
"userDetailsService"
)
@Service
(
"userDetailsService"
)
public
class
UserDetailsServiceImpl
implements
UserDetailsService
{
public
class
UserDetailsServiceImpl
implements
UserDetailsService
{
private
final
IUserManager
userManager
;
private
final
IUserManager
userManager
;
private
final
IRoleManager
roleManager
;
private
final
IMenuManager
menuManager
;
private
final
IMenuManager
menuManager
;
private
final
LoginProperties
loginProperties
;
private
final
LoginProperties
loginProperties
;
public
void
setEnableCache
(
boolean
enableCache
)
{
this
.
loginProperties
.
setCacheEnable
(
enableCache
);
}
/**
* 用户信息缓存
*
* @see {@link UserCacheClean}
*/
static
Map
<
String
,
JwtUserDto
>
userDtoCache
=
new
ConcurrentHashMap
<>();
@Override
@Override
public
JwtUserDto
loadUserByUsername
(
String
username
)
{
public
JwtUserDto
loadUserByUsername
(
String
username
)
{
boolean
searchDb
=
true
;
boolean
searchDb
=
true
;
JwtUserDto
jwtUserDto
=
null
;
JwtUserDto
jwtUserDto
=
null
;
if
(
loginProperties
.
isCacheEnable
()
&&
userDtoCache
.
containsKey
(
username
))
{
jwtUserDto
=
userDtoCache
.
get
(
username
);
// 检查dataScope是否修改
List
<
Long
>
dataScopes
=
jwtUserDto
.
getDataScopes
();
dataScopes
.
clear
();
//dataScopes.addAll(dataService.getDeptIds(jwtUserDto.getUser()));
searchDb
=
false
;
}
if
(
searchDb
)
{
if
(
searchDb
)
{
User
user
;
User
user
;
try
{
try
{
...
@@ -99,10 +79,8 @@ public class UserDetailsServiceImpl implements UserDetailsService {
...
@@ -99,10 +79,8 @@ public class UserDetailsServiceImpl implements UserDetailsService {
List
<
Long
>
dataScopes
=
new
ArrayList
<>();
List
<
Long
>
dataScopes
=
new
ArrayList
<>();
jwtUserDto
=
new
JwtUserDto
(
jwtUserDto
=
new
JwtUserDto
(
user
,
user
,
dataScopes
,
mapToGrantedAuthorities
(
user
)
mapToGrantedAuthorities
(
user
)
);
);
userDtoCache
.
put
(
username
,
jwtUserDto
);
}
}
}
}
return
jwtUserDto
;
return
jwtUserDto
;
...
...
src/main/resources/config/application-prod.yml
查看文件 @
8e4aadc
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
# 登录相关配置
# 登录相关配置
login
:
login
:
# 登录缓存
cache-enable
:
true
# 是否限制单用户登录
single-login
:
false
single-login
:
false
#配置数据源
#配置数据源
...
...
src/main/resources/config/application.yml
查看文件 @
8e4aadc
...
@@ -6,10 +6,11 @@ api:
...
@@ -6,10 +6,11 @@ api:
inCheckUrl
:
inCheckUrl
:
outNotifyUrl
:
outNotifyUrl
:
inNotifyUrl
:
inNotifyUrl
:
#codeResolveUrl: hellaCodeResolve
#
hella:
hella
:
#
host: 127.0.0.1
#
host: 127.0.0.1
# port: 9999
#port: 3333
# 文件存储路径
# 文件存储路径
file
:
file
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论