Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
87402a23
Commit
87402a23
authored
Aug 25, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日志级别
parent
b64ef6f0
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
76 additions
and
76 deletions
+76
-76
bootstrap/src/main/java/io/geekidea/springbootplus/config/ShiroConfig.java
+4
-4
bootstrap/src/main/java/io/geekidea/springbootplus/config/SpringBootPlusCorsConfig.java
+1
-1
bootstrap/src/main/java/io/geekidea/springbootplus/config/SpringBootPlusWebMvcConfig.java
+1
-1
bootstrap/src/main/java/io/geekidea/springbootplus/config/Swagger2Config.java
+1
-1
bootstrap/src/test/java/io/geekidea/springbootplus/test/FirebaseTest.java
+1
-1
common/src/main/java/com/wecloud/im/controller/AppHelloWorldController.java
+4
-4
common/src/main/java/com/wecloud/im/interceptor/DownloadInterceptor.java
+1
-1
common/src/main/java/com/wecloud/im/interceptor/ResourceInterceptor.java
+1
-1
common/src/main/java/com/wecloud/im/interceptor/UploadInterceptor.java
+1
-1
common/src/main/java/com/wecloud/im/netty/handler/NettyApiRequest.java
+1
-1
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+2
-2
common/src/main/java/com/wecloud/im/ws/cache/UserCache.java
+4
-4
common/src/main/java/com/wecloud/im/ws/receive/ReadWsData.java
+1
-1
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
+12
-12
common/src/main/java/com/wecloud/im/ws/service/impl/MangerChannelServiceImpl.java
+17
-17
config/src/main/java/io/geekidea/springbootplus/config/properties/SpringBootPlusStaticProperties.java
+1
-1
framework/src/main/java/io/geekidea/springbootplus/framework/common/controller/EnumController.java
+3
-3
framework/src/main/java/io/geekidea/springbootplus/framework/log/aop/BaseLogAop.java
+7
-7
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/JwtFilter.java
+2
-2
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmAppUser.java
+2
-2
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/service/impl/ShiroLoginServiceImpl.java
+1
-1
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/util/JwtTokenUtil.java
+1
-1
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/util/JwtUtil.java
+4
-4
framework/src/main/java/io/geekidea/springbootplus/framework/util/UploadUtil.java
+2
-2
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/HelloScheduled.java
+1
-1
No files found.
bootstrap/src/main/java/io/geekidea/springbootplus/config/ShiroConfig.java
View file @
87402a23
...
@@ -207,7 +207,7 @@ public class ShiroConfig {
...
@@ -207,7 +207,7 @@ public class ShiroConfig {
Map
<
String
,
String
>
filterChainDefinitionMap
=
new
LinkedHashMap
<>();
Map
<
String
,
String
>
filterChainDefinitionMap
=
new
LinkedHashMap
<>();
// 获取排除的路径
// 获取排除的路径
List
<
String
[]>
anonList
=
shiroProperties
.
getAnon
();
List
<
String
[]>
anonList
=
shiroProperties
.
getAnon
();
log
.
debug
(
"anonList:{}"
,
JSON
.
toJSONString
(
anonList
));
log
.
info
(
"anonList:{}"
,
JSON
.
toJSONString
(
anonList
));
if
(
CollectionUtils
.
isNotEmpty
(
anonList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
anonList
))
{
anonList
.
forEach
(
anonArray
->
{
anonList
.
forEach
(
anonArray
->
{
if
(
ArrayUtils
.
isNotEmpty
(
anonArray
))
{
if
(
ArrayUtils
.
isNotEmpty
(
anonArray
))
{
...
@@ -222,7 +222,7 @@ public class ShiroConfig {
...
@@ -222,7 +222,7 @@ public class ShiroConfig {
String
definitions
=
shiroProperties
.
getFilterChainDefinitions
();
String
definitions
=
shiroProperties
.
getFilterChainDefinitions
();
if
(
StringUtils
.
isNotBlank
(
definitions
))
{
if
(
StringUtils
.
isNotBlank
(
definitions
))
{
Map
<
String
,
String
>
section
=
IniUtil
.
parseIni
(
definitions
);
Map
<
String
,
String
>
section
=
IniUtil
.
parseIni
(
definitions
);
log
.
debug
(
"definitions:{}"
,
JSON
.
toJSONString
(
section
));
log
.
info
(
"definitions:{}"
,
JSON
.
toJSONString
(
section
));
for
(
Map
.
Entry
<
String
,
String
>
entry
:
section
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
section
.
entrySet
())
{
filterChainDefinitionMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
filterChainDefinitionMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
...
@@ -230,7 +230,7 @@ public class ShiroConfig {
...
@@ -230,7 +230,7 @@ public class ShiroConfig {
// 获取自定义权限路径配置集合
// 获取自定义权限路径配置集合
List
<
ShiroPermissionProperties
>
permissionConfigs
=
shiroProperties
.
getPermission
();
List
<
ShiroPermissionProperties
>
permissionConfigs
=
shiroProperties
.
getPermission
();
log
.
debug
(
"permissionConfigs:{}"
,
JSON
.
toJSONString
(
permissionConfigs
));
log
.
info
(
"permissionConfigs:{}"
,
JSON
.
toJSONString
(
permissionConfigs
));
if
(
CollectionUtils
.
isNotEmpty
(
permissionConfigs
))
{
if
(
CollectionUtils
.
isNotEmpty
(
permissionConfigs
))
{
for
(
ShiroPermissionProperties
permissionConfig
:
permissionConfigs
)
{
for
(
ShiroPermissionProperties
permissionConfig
:
permissionConfigs
)
{
String
url
=
permissionConfig
.
getUrl
();
String
url
=
permissionConfig
.
getUrl
();
...
@@ -261,7 +261,7 @@ public class ShiroConfig {
...
@@ -261,7 +261,7 @@ public class ShiroConfig {
filterChainDefinitionMap
.
put
(
"/**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/**"
,
ANON
);
}
}
log
.
debug
(
"filterChainMap:{}"
,
JSON
.
toJSONString
(
filterChainDefinitionMap
));
log
.
info
(
"filterChainMap:{}"
,
JSON
.
toJSONString
(
filterChainDefinitionMap
));
// 添加默认的filter
// 添加默认的filter
Map
<
String
,
String
>
newFilterChainDefinitionMap
=
addDefaultFilterDefinition
(
filterChainDefinitionMap
);
Map
<
String
,
String
>
newFilterChainDefinitionMap
=
addDefaultFilterDefinition
(
filterChainDefinitionMap
);
...
...
bootstrap/src/main/java/io/geekidea/springbootplus/config/SpringBootPlusCorsConfig.java
View file @
87402a23
...
@@ -46,7 +46,7 @@ public class SpringBootPlusCorsConfig {
...
@@ -46,7 +46,7 @@ public class SpringBootPlusCorsConfig {
*/
*/
@Bean
@Bean
public
FilterRegistrationBean
corsFilter
(
SpringBootPlusCorsProperties
corsProperties
)
{
public
FilterRegistrationBean
corsFilter
(
SpringBootPlusCorsProperties
corsProperties
)
{
log
.
debug
(
"corsProperties:{}"
,
corsProperties
);
log
.
info
(
"corsProperties:{}"
,
corsProperties
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
// 跨域配置
// 跨域配置
...
...
bootstrap/src/main/java/io/geekidea/springbootplus/config/SpringBootPlusWebMvcConfig.java
View file @
87402a23
...
@@ -147,7 +147,7 @@ public class SpringBootPlusWebMvcConfig implements WebMvcConfigurer {
...
@@ -147,7 +147,7 @@ public class SpringBootPlusWebMvcConfig implements WebMvcConfigurer {
filterConfig
=
springBootPlusProperties
.
getFilter
();
filterConfig
=
springBootPlusProperties
.
getFilter
();
interceptorConfig
=
springBootPlusProperties
.
getInterceptor
();
interceptorConfig
=
springBootPlusProperties
.
getInterceptor
();
// 打印SpringBootPlusProperties配置信息
// 打印SpringBootPlusProperties配置信息
log
.
debug
(
"SpringBootPlusProperties:{}"
,
JSON
.
toJSONString
(
springBootPlusProperties
));
log
.
info
(
"SpringBootPlusProperties:{}"
,
JSON
.
toJSONString
(
springBootPlusProperties
));
}
}
@Override
@Override
...
...
bootstrap/src/main/java/io/geekidea/springbootplus/config/Swagger2Config.java
View file @
87402a23
...
@@ -244,7 +244,7 @@ public class Swagger2Config {
...
@@ -244,7 +244,7 @@ public class Swagger2Config {
* @return
* @return
*/
*/
public
String
[]
getBasePackages
()
{
public
String
[]
getBasePackages
()
{
log
.
debug
(
"swaggerProperties = "
+
swaggerProperties
);
log
.
info
(
"swaggerProperties = "
+
swaggerProperties
);
String
basePackage
=
swaggerProperties
.
getBasePackage
();
String
basePackage
=
swaggerProperties
.
getBasePackage
();
if
(
StringUtils
.
isBlank
(
basePackage
))
{
if
(
StringUtils
.
isBlank
(
basePackage
))
{
throw
new
SpringBootPlusConfigException
(
"Swagger basePackage不能为空"
);
throw
new
SpringBootPlusConfigException
(
"Swagger basePackage不能为空"
);
...
...
bootstrap/src/test/java/io/geekidea/springbootplus/test/FirebaseTest.java
View file @
87402a23
...
@@ -62,7 +62,7 @@ public class FirebaseTest {
...
@@ -62,7 +62,7 @@ public class FirebaseTest {
BufferedReader
reader
=
new
BufferedReader
(
in
);
BufferedReader
reader
=
new
BufferedReader
(
in
);
String
line
=
reader
.
readLine
();
String
line
=
reader
.
readLine
();
log
.
debug
(
line
);
log
.
info
(
line
);
wr
.
close
();
wr
.
close
();
reader
.
close
();
reader
.
close
();
...
...
common/src/main/java/com/wecloud/im/controller/AppHelloWorldController.java
View file @
87402a23
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
// @OperationLog(name = "helloWorld")
// @OperationLog(name = "helloWorld")
// @ApiOperation(value = "helloWorld", response = String.class)
// @ApiOperation(value = "helloWorld", response = String.class)
// public ApiResult<String> helloWorld() throws IOException {
// public ApiResult<String> helloWorld() throws IOException {
// log.
debug
("Hello World...app");
// log.
info
("Hello World...app");
// return ApiResult.ok("Hello World app");
// return ApiResult.ok("Hello World app");
// }
// }
//
//
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
// @OperationLog(name = "needRole")
// @OperationLog(name = "needRole")
// @ApiOperation(value = "needRole", response = String.class)
// @ApiOperation(value = "needRole", response = String.class)
// public ApiResult<String> needRole() throws IOException {
// public ApiResult<String> needRole() throws IOException {
// log.
debug
("Hello World...app");
// log.
info
("Hello World...app");
// return ApiResult.ok("Hello World app");
// return ApiResult.ok("Hello World app");
// }
// }
//
//
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
// @ApiOperation(value = "needRoleAdmin", response = String.class)
// @ApiOperation(value = "needRoleAdmin", response = String.class)
// @RequiresRoles("app:admin")
// @RequiresRoles("app:admin")
// public ApiResult<String> needRoleAdmin() throws IOException {
// public ApiResult<String> needRoleAdmin() throws IOException {
// log.
debug
("Hello World...app");
// log.
info
("Hello World...app");
// return ApiResult.ok("Hello World needRoleAdmin");
// return ApiResult.ok("Hello World needRoleAdmin");
// }
// }
//
//
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
// @ApiOperation(value = "needRoleAll", response = String.class)
// @ApiOperation(value = "needRoleAll", response = String.class)
// @RequiresRoles("app:all")
// @RequiresRoles("app:all")
// public ApiResult<String> needRoleAll() throws IOException {
// public ApiResult<String> needRoleAll() throws IOException {
// log.
debug
("Hello World...app");
// log.
info
("Hello World...app");
// return ApiResult.ok("Hello World needRoleAll");
// return ApiResult.ok("Hello World needRoleAll");
// }
// }
//
//
...
...
common/src/main/java/com/wecloud/im/interceptor/DownloadInterceptor.java
View file @
87402a23
...
@@ -46,7 +46,7 @@ public class DownloadInterceptor extends HandlerInterceptorAdapter {
...
@@ -46,7 +46,7 @@ public class DownloadInterceptor extends HandlerInterceptorAdapter {
// 访问全路径
// 访问全路径
String
fullUrl
=
request
.
getRequestURL
().
toString
();
String
fullUrl
=
request
.
getRequestURL
().
toString
();
// 下载拦截器,业务处理代码
// 下载拦截器,业务处理代码
log
.
debug
(
"DownloadInterceptor..."
);
log
.
info
(
"DownloadInterceptor..."
);
// 访问token,如果需要,可以设置参数,进行鉴权
// 访问token,如果需要,可以设置参数,进行鉴权
// String token = request.getParameter(JwtTokenUtil.getTokenName());
// String token = request.getParameter(JwtTokenUtil.getTokenName());
return
true
;
return
true
;
...
...
common/src/main/java/com/wecloud/im/interceptor/ResourceInterceptor.java
View file @
87402a23
...
@@ -46,7 +46,7 @@ public class ResourceInterceptor extends HandlerInterceptorAdapter {
...
@@ -46,7 +46,7 @@ public class ResourceInterceptor extends HandlerInterceptorAdapter {
// 访问全路径
// 访问全路径
String
fullUrl
=
request
.
getRequestURL
().
toString
();
String
fullUrl
=
request
.
getRequestURL
().
toString
();
// 资源拦截器,业务处理代码
// 资源拦截器,业务处理代码
log
.
debug
(
"ResourceInterceptor..."
);
log
.
info
(
"ResourceInterceptor..."
);
// 访问token,如果需要,可以设置参数,进行鉴权
// 访问token,如果需要,可以设置参数,进行鉴权
// String token = request.getParameter(JwtTokenUtil.getTokenName());
// String token = request.getParameter(JwtTokenUtil.getTokenName());
return
true
;
return
true
;
...
...
common/src/main/java/com/wecloud/im/interceptor/UploadInterceptor.java
View file @
87402a23
...
@@ -47,7 +47,7 @@ public class UploadInterceptor extends HandlerInterceptorAdapter {
...
@@ -47,7 +47,7 @@ public class UploadInterceptor extends HandlerInterceptorAdapter {
// 访问全路径
// 访问全路径
String
fullUrl
=
request
.
getRequestURL
().
toString
();
String
fullUrl
=
request
.
getRequestURL
().
toString
();
// 上传拦截器,业务处理代码
// 上传拦截器,业务处理代码
log
.
debug
(
"UploadInterceptor..."
);
log
.
info
(
"UploadInterceptor..."
);
// 访问token,如果需要,可以设置参数,进行鉴权
// 访问token,如果需要,可以设置参数,进行鉴权
// String token = request.getParameter(JwtTokenUtil.getTokenName());
// String token = request.getParameter(JwtTokenUtil.getTokenName());
return
true
;
return
true
;
...
...
common/src/main/java/com/wecloud/im/netty/handler/NettyApiRequest.java
View file @
87402a23
...
@@ -64,7 +64,7 @@ public class NettyApiRequest {
...
@@ -64,7 +64,7 @@ public class NettyApiRequest {
String
body
=
FullHttpRequestUtils
.
getBody
(
httpRequest
);
String
body
=
FullHttpRequestUtils
.
getBody
(
httpRequest
);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"httpRequest:\n"
+
httpRequest
.
toString
()
+
"\n"
+
body
);
log
.
info
(
"httpRequest:\n"
+
httpRequest
.
toString
()
+
"\n"
+
body
);
}
}
if
(
path
.
contains
(
WsConstants
.
WS_URL
))
{
if
(
path
.
contains
(
WsConstants
.
WS_URL
))
{
...
...
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
87402a23
...
@@ -113,7 +113,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -113,7 +113,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
Integer
repetitionConversation
=
getRepetitionConversation
(
client
.
getId
(),
client2
.
getId
());
Integer
repetitionConversation
=
getRepetitionConversation
(
client
.
getId
(),
client2
.
getId
());
if
(
repetitionConversation
!=
0
)
{
if
(
repetitionConversation
!=
0
)
{
log
.
debug
(
"repetitionConversation != 0"
);
log
.
info
(
"repetitionConversation != 0"
);
// 返回已存在的会话id
// 返回已存在的会话id
ImConversation
repetitionConversationInfo
=
imConversationMapper
.
getRepetitionConversationInfo
(
client
.
getId
(),
client2
.
getId
());
ImConversation
repetitionConversationInfo
=
imConversationMapper
.
getRepetitionConversationInfo
(
client
.
getId
(),
client2
.
getId
());
ImConversationCreateVo
imConversationCreateVo
=
new
ImConversationCreateVo
();
ImConversationCreateVo
imConversationCreateVo
=
new
ImConversationCreateVo
();
...
@@ -146,7 +146,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -146,7 +146,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
}
}
if
(
imConversationCreate
.
getAttributes
().
equals
(
hashMap
))
{
if
(
imConversationCreate
.
getAttributes
().
equals
(
hashMap
))
{
log
.
debug
(
imConversationCreate
.
getAttributes
()
+
",出现重复"
);
log
.
info
(
imConversationCreate
.
getAttributes
()
+
",出现重复"
);
ImConversationCreateVo
imConversationCreateVo
=
new
ImConversationCreateVo
();
ImConversationCreateVo
imConversationCreateVo
=
new
ImConversationCreateVo
();
imConversationCreateVo
.
setId
(
repetitionConversationInfo
.
getId
());
imConversationCreateVo
.
setId
(
repetitionConversationInfo
.
getId
());
// 为重复
// 为重复
...
...
common/src/main/java/com/wecloud/im/ws/cache/UserCache.java
View file @
87402a23
...
@@ -68,7 +68,7 @@ public class UserCache {
...
@@ -68,7 +68,7 @@ public class UserCache {
// 获取机器内网ip
// 获取机器内网ip
static
{
static
{
lAN_IP
=
getLocalIpAddress
();
lAN_IP
=
getLocalIpAddress
();
log
.
debug
(
"lAN_IP:"
+
lAN_IP
);
log
.
info
(
"lAN_IP:"
+
lAN_IP
);
}
}
/**
/**
...
@@ -124,7 +124,7 @@ public class UserCache {
...
@@ -124,7 +124,7 @@ public class UserCache {
}
}
}
}
}
catch
(
SocketException
e
)
{
}
catch
(
SocketException
e
)
{
log
.
debug
(
"获取本机IP地址失败。"
+
e
);
log
.
info
(
"获取本机IP地址失败。"
+
e
);
}
}
...
@@ -138,7 +138,7 @@ public class UserCache {
...
@@ -138,7 +138,7 @@ public class UserCache {
* @param id
* @param id
*/
*/
public
void
online
(
String
id
)
{
public
void
online
(
String
id
)
{
log
.
debug
(
"ws用户上线保存redis连接ip:"
+
lAN_IP
,
",uid:"
);
log
.
info
(
"ws用户上线保存redis连接ip:"
+
lAN_IP
,
",uid:"
);
// redisUtils.hset(KEY_BASE + id, PRIVATE_IP_KEY, lAN_IP);
// redisUtils.hset(KEY_BASE + id, PRIVATE_IP_KEY, lAN_IP);
// redisUtils.hset(KEY_BASE + id, ONLINE_STATUS_KEY, String.valueOf(ONLINE));
// redisUtils.hset(KEY_BASE + id, ONLINE_STATUS_KEY, String.valueOf(ONLINE));
}
}
...
@@ -149,7 +149,7 @@ public class UserCache {
...
@@ -149,7 +149,7 @@ public class UserCache {
* @param id
* @param id
*/
*/
public
void
offline
(
String
id
)
{
public
void
offline
(
String
id
)
{
log
.
debug
(
"ws用户离线删除redis key,uid:"
+
id
);
log
.
info
(
"ws用户离线删除redis key,uid:"
+
id
);
// redisUtils.kdel(KEY_BASE + id);
// redisUtils.kdel(KEY_BASE + id);
}
}
...
...
common/src/main/java/com/wecloud/im/ws/receive/ReadWsData.java
View file @
87402a23
...
@@ -45,7 +45,7 @@ public class ReadWsData {
...
@@ -45,7 +45,7 @@ public class ReadWsData {
String
clientId
=
ctx
.
channel
().
attr
(
MangerChannelService
.
CLIENT_ID
).
get
();
String
clientId
=
ctx
.
channel
().
attr
(
MangerChannelService
.
CLIENT_ID
).
get
();
if
(
PING
.
equals
(
data
))
{
if
(
PING
.
equals
(
data
))
{
log
.
debug
(
"收到心跳:"
+
clientId
);
log
.
info
(
"收到心跳:"
+
clientId
);
return
;
return
;
}
}
...
...
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
View file @
87402a23
...
@@ -46,7 +46,7 @@ public class PushTask {
...
@@ -46,7 +46,7 @@ public class PushTask {
*/
*/
@Async
@Async
public
void
push
(
HashMap
<
String
,
String
>
pushMap
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
public
void
push
(
HashMap
<
String
,
String
>
pushMap
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
log
.
debug
(
"push:"
+
imClientReceiver
.
getClientId
());
log
.
info
(
"push:"
+
imClientReceiver
.
getClientId
());
PushModel
pushModel
=
new
PushModel
();
PushModel
pushModel
=
new
PushModel
();
...
@@ -61,7 +61,7 @@ public class PushTask {
...
@@ -61,7 +61,7 @@ public class PushTask {
// 校验参数
// 校验参数
if
(
imClientReceiver
.
getValid
()
==
null
||
imClientReceiver
.
getDeviceToken
()
==
null
||
imClientReceiver
.
getDeviceType
()
==
null
)
{
if
(
imClientReceiver
.
getValid
()
==
null
||
imClientReceiver
.
getDeviceToken
()
==
null
||
imClientReceiver
.
getDeviceType
()
==
null
)
{
log
.
debug
(
"push参数错误"
);
log
.
info
(
"push参数错误"
);
return
;
return
;
}
}
// 设备不想收到推送提醒, 1想, 0不想
// 设备不想收到推送提醒, 1想, 0不想
...
@@ -81,7 +81,7 @@ public class PushTask {
...
@@ -81,7 +81,7 @@ public class PushTask {
private
void
android
(
PushModel
pushModel
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
private
void
android
(
PushModel
pushModel
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
// 安卓推送通道,友盟:1;firebase:2; 信鸽3
// 安卓推送通道,友盟:1;firebase:2; 信鸽3
if
(
imApplication
.
getAndroidPushChannel
()
==
1
)
{
if
(
imApplication
.
getAndroidPushChannel
()
==
1
)
{
log
.
debug
(
"友盟"
);
log
.
info
(
"友盟"
);
// 友盟推送
// 友盟推送
PushUtils
pushUtils
=
new
PushUtils
(
imApplication
.
getUmengKey
(),
imApplication
.
getUmengSecret
());
PushUtils
pushUtils
=
new
PushUtils
(
imApplication
.
getUmengKey
(),
imApplication
.
getUmengSecret
());
...
@@ -97,7 +97,7 @@ public class PushTask {
...
@@ -97,7 +97,7 @@ public class PushTask {
}
else
if
(
imApplication
.
getAndroidPushChannel
()
==
2
)
{
}
else
if
(
imApplication
.
getAndroidPushChannel
()
==
2
)
{
//firebase:2
//firebase:2
log
.
debug
(
"firebase"
);
log
.
info
(
"firebase"
);
String
jsonStr
=
null
;
String
jsonStr
=
null
;
try
{
try
{
...
@@ -131,7 +131,7 @@ public class PushTask {
...
@@ -131,7 +131,7 @@ public class PushTask {
String
line
=
reader
.
readLine
();
String
line
=
reader
.
readLine
();
log
.
debug
(
line
);
log
.
info
(
line
);
wr
.
close
();
wr
.
close
();
reader
.
close
();
reader
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -140,11 +140,11 @@ public class PushTask {
...
@@ -140,11 +140,11 @@ public class PushTask {
}
else
if
(
imApplication
.
getAndroidPushChannel
()
==
3
)
{
}
else
if
(
imApplication
.
getAndroidPushChannel
()
==
3
)
{
// 信鸽3
// 信鸽3
log
.
debug
(
"信鸽3"
);
log
.
info
(
"信鸽3"
);
}
else
{
}
else
{
log
.
debug
(
"没有找到推送类型"
);
log
.
info
(
"没有找到推送类型"
);
return
;
return
;
}
}
}
}
...
@@ -152,7 +152,7 @@ public class PushTask {
...
@@ -152,7 +152,7 @@ public class PushTask {
private
void
ios
(
PushModel
pushModel
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
private
void
ios
(
PushModel
pushModel
,
ImClient
imClientReceiver
,
ImApplication
imApplication
)
{
// ios推送通道,友盟:1;firebase:2; apns原生:3
// ios推送通道,友盟:1;firebase:2; apns原生:3
if
(
imApplication
.
getIosPushChannel
()
==
1
)
{
if
(
imApplication
.
getIosPushChannel
()
==
1
)
{
log
.
debug
(
"友盟"
);
log
.
info
(
"友盟"
);
// 友盟推送
// 友盟推送
PushUtils
pushUtils
=
new
PushUtils
(
imApplication
.
getUmengKey
(),
imApplication
.
getUmengSecret
());
PushUtils
pushUtils
=
new
PushUtils
(
imApplication
.
getUmengKey
(),
imApplication
.
getUmengSecret
());
...
@@ -170,7 +170,7 @@ public class PushTask {
...
@@ -170,7 +170,7 @@ public class PushTask {
}
else
if
(
imApplication
.
getIosPushChannel
()
==
2
)
{
}
else
if
(
imApplication
.
getIosPushChannel
()
==
2
)
{
//firebase:2
//firebase:2
log
.
debug
(
"firebase"
);
log
.
info
(
"firebase"
);
String
jsonStr
=
null
;
String
jsonStr
=
null
;
...
@@ -204,7 +204,7 @@ public class PushTask {
...
@@ -204,7 +204,7 @@ public class PushTask {
String
line
=
reader
.
readLine
();
String
line
=
reader
.
readLine
();
log
.
debug
(
line
);
log
.
info
(
line
);
wr
.
close
();
wr
.
close
();
reader
.
close
();
reader
.
close
();
...
@@ -215,10 +215,10 @@ public class PushTask {
...
@@ -215,10 +215,10 @@ public class PushTask {
}
else
if
(
imApplication
.
getIosPushChannel
()
==
3
)
{
}
else
if
(
imApplication
.
getIosPushChannel
()
==
3
)
{
// apns原生:3
// apns原生:3
log
.
debug
(
"apns原生"
);
log
.
info
(
"apns原生"
);
}
else
{
}
else
{
log
.
debug
(
"没有找到推送类型"
);
log
.
info
(
"没有找到推送类型"
);
return
;
return
;
}
}
}
}
...
...
common/src/main/java/com/wecloud/im/ws/service/impl/MangerChannelServiceImpl.java
View file @
87402a23
...
@@ -123,13 +123,13 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -123,13 +123,13 @@ public class MangerChannelServiceImpl implements MangerChannelService {
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// if (null == nioSocketChannel) {
// if (null == nioSocketChannel) {
// userCache.offline(String.valueOf(userId));
// userCache.offline(String.valueOf(userId));
// log.
debug
("rpc-writeData连接为空:" + userId + "," + msg);
// log.
info
("rpc-writeData连接为空:" + userId + "," + msg);
// return false;
// return false;
// }
// }
//
//
// // 判断连接是否断开
// // 判断连接是否断开
// if (nioSocketChannel.isShutdown()) {
// if (nioSocketChannel.isShutdown()) {
// log.
debug
("rpc-writeData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// log.
info
("rpc-writeData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// return false;
// return false;
// }
// }
//
//
...
@@ -168,19 +168,19 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -168,19 +168,19 @@ public class MangerChannelServiceImpl implements MangerChannelService {
//
//
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// if (null == nioSocketChannel) {
// if (null == nioSocketChannel) {
// log.
debug
("rpc-kickWriteData连接为空:" + userId + "," + msg);
// log.
info
("rpc-kickWriteData连接为空:" + userId + "," + msg);
// return false;
// return false;
// }
// }
//
//
// // 判断连接是否断开
// // 判断连接是否断开
// if (nioSocketChannel.isShutdown()) {
// if (nioSocketChannel.isShutdown()) {
// log.
debug
("rpc-kickWriteData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// log.
info
("rpc-kickWriteData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// nioSocketChannel.close();
// nioSocketChannel.close();
// return false;
// return false;
// }
// }
//
//
// if (log.isDebugEnabled()) {
// if (log.isDebugEnabled()) {
// log.
debug
("rpc-kickWriteData:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// log.
info
("rpc-kickWriteData:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// }
// }
//
//
// ChannelFuture channelFuture = nioSocketChannel.writeAndFlush(new TextWebSocketFrame(msg));
// ChannelFuture channelFuture = nioSocketChannel.writeAndFlush(new TextWebSocketFrame(msg));
...
@@ -188,7 +188,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -188,7 +188,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
// //执行后回调的方法
// //执行后回调的方法
// (ChannelFutureListener) channelFuture1 -> {
// (ChannelFutureListener) channelFuture1 -> {
// if (log.isDebugEnabled()) {
// if (log.isDebugEnabled()) {
// log.
debug
("rpc-netty踢人线程异步执行结果:" + channelFuture1.isDone() + ",业务执行结果:" + channelFuture1.isSuccess()
// log.
info
("rpc-netty踢人线程异步执行结果:" + channelFuture1.isDone() + ",业务执行结果:" + channelFuture1.isSuccess()
// + ";\nkickWriteData:" + userId + "," + msg + ",channelId:" + nioSocketChannel.id().asLongText());
// + ";\nkickWriteData:" + userId + "," + msg + ",channelId:" + nioSocketChannel.id().asLongText());
// }
// }
// });
// });
...
@@ -213,7 +213,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -213,7 +213,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
// Future<Boolean> future = THREAD_POOL_RPC_WRITE_EXECUTOR.submit(() -> {
// Future<Boolean> future = THREAD_POOL_RPC_WRITE_EXECUTOR.submit(() -> {
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// if (null == nioSocketChannel) {
// if (null == nioSocketChannel) {
// log.
debug
("rpc-closeOldChannel连接为空:" + userId);
// log.
info
("rpc-closeOldChannel连接为空:" + userId);
// return false;
// return false;
// }
// }
// // 关闭
// // 关闭
...
@@ -237,18 +237,18 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -237,18 +237,18 @@ public class MangerChannelServiceImpl implements MangerChannelService {
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// NioSocketChannel nioSocketChannel = get(String.valueOf(userId));
// if (null == nioSocketChannel) {
// if (null == nioSocketChannel) {
// userCache.offline(String.valueOf(userId));
// userCache.offline(String.valueOf(userId));
// log.
debug
("writeData连接为空:" + userId + "," + msg);
// log.
info
("writeData连接为空:" + userId + "," + msg);
// return false;
// return false;
// }
// }
//
//
// // 判断连接是否断开
// // 判断连接是否断开
// if (nioSocketChannel.isShutdown()) {
// if (nioSocketChannel.isShutdown()) {
// log.
debug
("writeData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// log.
info
("writeData连接断开:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// return false;
// return false;
// }
// }
//
//
// if (log.isDebugEnabled()) {
// if (log.isDebugEnabled()) {
// log.
debug
("writeData:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// log.
info
("writeData:" + userId + "," + msg + ",\nchannelId:" + nioSocketChannel.id().asLongText());
// }
// }
//
//
// ChannelFuture channelFuture = nioSocketChannel.writeAndFlush(new TextWebSocketFrame(msg));
// ChannelFuture channelFuture = nioSocketChannel.writeAndFlush(new TextWebSocketFrame(msg));
...
@@ -256,7 +256,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -256,7 +256,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
// //执行后回调的方法
// //执行后回调的方法
// (ChannelFutureListener) channelFuture1 -> {
// (ChannelFutureListener) channelFuture1 -> {
// if (log.isDebugEnabled()) {
// if (log.isDebugEnabled()) {
// log.
debug
("netty线程异步执行结果:" + channelFuture1.isDone() + ",业务执行结果:" + channelFuture1.isSuccess()
// log.
info
("netty线程异步执行结果:" + channelFuture1.isDone() + ",业务执行结果:" + channelFuture1.isSuccess()
// + ";\nwriteData:" + userId + "," + msg + ",channelId:" + nioSocketChannel.id().asLongText());
// + ";\nwriteData:" + userId + "," + msg + ",channelId:" + nioSocketChannel.id().asLongText());
// }
// }
// });
// });
...
@@ -289,14 +289,14 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -289,14 +289,14 @@ public class MangerChannelServiceImpl implements MangerChannelService {
if
(
null
==
nioSocketChannel
)
{
if
(
null
==
nioSocketChannel
)
{
// userCache.offline(toAppKey + toClientId);
// userCache.offline(toAppKey + toClientId);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"writeData 不存在 连接为空:"
+
toAppKey
+
toClientId
);
log
.
info
(
"writeData 不存在 连接为空:"
+
toAppKey
+
toClientId
);
}
}
return
false
;
return
false
;
}
}
// 判断连接是否断开
// 判断连接是否断开
if
(
nioSocketChannel
.
isShutdown
())
{
if
(
nioSocketChannel
.
isShutdown
())
{
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"writeData连接断开:"
+
toAppKey
+
toClientId
+
"channelId:"
+
nioSocketChannel
.
id
().
asLongText
());
log
.
info
(
"writeData连接断开:"
+
toAppKey
+
toClientId
+
"channelId:"
+
nioSocketChannel
.
id
().
asLongText
());
}
}
return
false
;
return
false
;
}
}
...
@@ -311,20 +311,20 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -311,20 +311,20 @@ public class MangerChannelServiceImpl implements MangerChannelService {
if
(
null
==
nioSocketChannel
)
{
if
(
null
==
nioSocketChannel
)
{
// userCache.offline(toAppKey + toClientId);
// userCache.offline(toAppKey + toClientId);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"writeData连接为空:"
+
toAppKey
+
toClientId
+
","
+
msg
);
log
.
info
(
"writeData连接为空:"
+
toAppKey
+
toClientId
+
","
+
msg
);
}
}
return
false
;
return
false
;
}
}
// 判断连接是否断开
// 判断连接是否断开
if
(
nioSocketChannel
.
isShutdown
())
{
if
(
nioSocketChannel
.
isShutdown
())
{
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"writeData连接断开:"
+
toAppKey
+
toClientId
+
","
+
msg
+
",\nchannelId:"
+
nioSocketChannel
.
id
().
asLongText
());
log
.
info
(
"writeData连接断开:"
+
toAppKey
+
toClientId
+
","
+
msg
+
",\nchannelId:"
+
nioSocketChannel
.
id
().
asLongText
());
}
}
return
false
;
return
false
;
}
}
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"writeData:"
+
toAppKey
+
","
+
toClientId
+
","
+
msg
+
",\nchannelId:"
+
nioSocketChannel
.
id
().
asLongText
());
log
.
info
(
"writeData:"
+
toAppKey
+
","
+
toClientId
+
","
+
msg
+
",\nchannelId:"
+
nioSocketChannel
.
id
().
asLongText
());
}
}
ChannelFuture
channelFuture
=
nioSocketChannel
.
writeAndFlush
(
new
TextWebSocketFrame
(
msg
));
ChannelFuture
channelFuture
=
nioSocketChannel
.
writeAndFlush
(
new
TextWebSocketFrame
(
msg
));
...
@@ -332,7 +332,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
...
@@ -332,7 +332,7 @@ public class MangerChannelServiceImpl implements MangerChannelService {
//执行后回调的方法
//执行后回调的方法
(
ChannelFutureListener
)
channelFuture1
->
{
(
ChannelFutureListener
)
channelFuture1
->
{
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"netty线程异步执行结果:"
+
channelFuture1
.
isDone
()
+
",业务执行结果:"
+
channelFuture1
.
isSuccess
()
log
.
info
(
"netty线程异步执行结果:"
+
channelFuture1
.
isDone
()
+
",业务执行结果:"
+
channelFuture1
.
isSuccess
()
+
";\nwriteData:"
+
toAppKey
+
toClientId
+
","
+
msg
+
",channelId:"
+
nioSocketChannel
.
id
().
asLongText
());
+
";\nwriteData:"
+
toAppKey
+
toClientId
+
","
+
msg
+
",channelId:"
+
nioSocketChannel
.
id
().
asLongText
());
}
}
});
});
...
...
config/src/main/java/io/geekidea/springbootplus/config/properties/SpringBootPlusStaticProperties.java
View file @
87402a23
...
@@ -42,7 +42,7 @@ public class SpringBootPlusStaticProperties {
...
@@ -42,7 +42,7 @@ public class SpringBootPlusStaticProperties {
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
INFO_PROJECT_VERSION
=
this
.
infoProjectVersion
;
INFO_PROJECT_VERSION
=
this
.
infoProjectVersion
;
log
.
debug
(
"INFO_PROJECT_VERSION:"
+
INFO_PROJECT_VERSION
);
log
.
info
(
"INFO_PROJECT_VERSION:"
+
INFO_PROJECT_VERSION
);
}
}
}
}
framework/src/main/java/io/geekidea/springbootplus/framework/common/controller/EnumController.java
View file @
87402a23
...
@@ -63,7 +63,7 @@ public class EnumController {
...
@@ -63,7 +63,7 @@ public class EnumController {
@GetMapping
(
"/enum"
)
@GetMapping
(
"/enum"
)
public
ApiResult
<
Map
<
String
,
Map
<
Integer
,
EnumVo
<?
extends
BaseEnum
>>>>
enumList
()
{
public
ApiResult
<
Map
<
String
,
Map
<
Integer
,
EnumVo
<?
extends
BaseEnum
>>>>
enumList
()
{
log
.
debug
(
"enumList..."
);
log
.
info
(
"enumList..."
);
return
ApiResult
.
ok
(
BaseEnumUtil
.
getEnumMap
());
return
ApiResult
.
ok
(
BaseEnumUtil
.
getEnumMap
());
}
}
...
@@ -76,7 +76,7 @@ public class EnumController {
...
@@ -76,7 +76,7 @@ public class EnumController {
enumPackages
.
addAll
(
FRAMEWORK_ENUM_PACKAGES
);
enumPackages
.
addAll
(
FRAMEWORK_ENUM_PACKAGES
);
// 获取BaseEnum接口的所有实现
// 获取BaseEnum接口的所有实现
log
.
debug
(
"enumPackages:"
+
enumPackages
);
log
.
info
(
"enumPackages:"
+
enumPackages
);
Reflections
reflections
=
new
Reflections
(
enumPackages
);
Reflections
reflections
=
new
Reflections
(
enumPackages
);
Set
<
Class
<?
extends
BaseEnum
>>
set
=
reflections
.
getSubTypesOf
(
BaseEnum
.
class
);
Set
<
Class
<?
extends
BaseEnum
>>
set
=
reflections
.
getSubTypesOf
(
BaseEnum
.
class
);
if
(
CollectionUtils
.
isEmpty
(
set
))
{
if
(
CollectionUtils
.
isEmpty
(
set
))
{
...
@@ -98,7 +98,7 @@ public class EnumController {
...
@@ -98,7 +98,7 @@ public class EnumController {
// 设置map
// 设置map
BaseEnumUtil
.
getEnumMap
().
put
(
clazz
.
getName
(),
enumVoMap
);
BaseEnumUtil
.
getEnumMap
().
put
(
clazz
.
getName
(),
enumVoMap
);
}
}
log
.
debug
(
"enumMap:{}"
,
BaseEnumUtil
.
getEnumMap
());
log
.
info
(
"enumMap:{}"
,
BaseEnumUtil
.
getEnumMap
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"获取BaseEnum枚举map异常"
,
e
);
log
.
error
(
"获取BaseEnum枚举map异常"
,
e
);
}
}
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/log/aop/BaseLogAop.java
View file @
87402a23
...
@@ -171,13 +171,13 @@ public abstract class BaseLogAop {
...
@@ -171,13 +171,13 @@ public abstract class BaseLogAop {
requestIdType
=
logAopConfig
.
getRequestIdType
();
requestIdType
=
logAopConfig
.
getRequestIdType
();
operationLogConfig
=
springBootPlusAopProperties
.
getOperationLog
();
operationLogConfig
=
springBootPlusAopProperties
.
getOperationLog
();
loginLogConfig
=
springBootPlusAopProperties
.
getLoginLog
();
loginLogConfig
=
springBootPlusAopProperties
.
getLoginLog
();
log
.
debug
(
"logAopConfig = "
+
logAopConfig
);
log
.
info
(
"logAopConfig = "
+
logAopConfig
);
log
.
debug
(
"logPrintType = "
+
logPrintType
);
log
.
info
(
"logPrintType = "
+
logPrintType
);
log
.
debug
(
"enableRequestId = "
+
enableRequestId
);
log
.
info
(
"enableRequestId = "
+
enableRequestId
);
log
.
debug
(
"requestIdType = "
+
requestIdType
);
log
.
info
(
"requestIdType = "
+
requestIdType
);
log
.
debug
(
"operationLogConfig = "
+
operationLogConfig
);
log
.
info
(
"operationLogConfig = "
+
operationLogConfig
);
log
.
debug
(
"loginLogConfig = "
+
loginLogConfig
);
log
.
info
(
"loginLogConfig = "
+
loginLogConfig
);
log
.
debug
(
"contextPath = "
+
contextPath
);
log
.
info
(
"contextPath = "
+
contextPath
);
}
}
/**
/**
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/JwtFilter.java
View file @
87402a23
...
@@ -114,7 +114,7 @@ public class JwtFilter extends AuthenticatingFilter {
...
@@ -114,7 +114,7 @@ public class JwtFilter extends AuthenticatingFilter {
@Override
@Override
protected
boolean
isAccessAllowed
(
ServletRequest
request
,
ServletResponse
response
,
Object
mappedValue
)
{
protected
boolean
isAccessAllowed
(
ServletRequest
request
,
ServletResponse
response
,
Object
mappedValue
)
{
String
url
=
WebUtils
.
toHttp
(
request
).
getRequestURI
();
String
url
=
WebUtils
.
toHttp
(
request
).
getRequestURI
();
log
.
debug
(
"isAccessAllowed url:{}"
,
url
);
log
.
info
(
"isAccessAllowed url:{}"
,
url
);
if
(
this
.
isLoginRequest
(
request
,
response
))
{
if
(
this
.
isLoginRequest
(
request
,
response
))
{
return
true
;
return
true
;
}
}
...
@@ -142,7 +142,7 @@ public class JwtFilter extends AuthenticatingFilter {
...
@@ -142,7 +142,7 @@ public class JwtFilter extends AuthenticatingFilter {
@Override
@Override
protected
boolean
onLoginSuccess
(
AuthenticationToken
token
,
Subject
subject
,
ServletRequest
request
,
ServletResponse
response
)
throws
Exception
{
protected
boolean
onLoginSuccess
(
AuthenticationToken
token
,
Subject
subject
,
ServletRequest
request
,
ServletResponse
response
)
throws
Exception
{
String
url
=
WebUtils
.
toHttp
(
request
).
getRequestURI
();
String
url
=
WebUtils
.
toHttp
(
request
).
getRequestURI
();
log
.
debug
(
"鉴权成功,token:{},url:{}"
,
token
,
url
);
log
.
info
(
"鉴权成功,token:{},url:{}"
,
token
,
url
);
// 刷新token
// 刷新token
JwtToken
jwtToken
=
(
JwtToken
)
token
;
JwtToken
jwtToken
=
(
JwtToken
)
token
;
HttpServletResponse
httpServletResponse
=
WebUtils
.
toHttp
(
response
);
HttpServletResponse
httpServletResponse
=
WebUtils
.
toHttp
(
response
);
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmAppUser.java
View file @
87402a23
...
@@ -59,7 +59,7 @@ public class JwtRealmAppUser extends AuthorizingRealm {
...
@@ -59,7 +59,7 @@ public class JwtRealmAppUser extends AuthorizingRealm {
*/
*/
@Override
@Override
protected
AuthorizationInfo
doGetAuthorizationInfo
(
PrincipalCollection
principalCollection
)
{
protected
AuthorizationInfo
doGetAuthorizationInfo
(
PrincipalCollection
principalCollection
)
{
log
.
debug
(
"doGetAuthorizationInfo principalCollection..."
);
log
.
info
(
"doGetAuthorizationInfo principalCollection..."
);
// 设置角色/权限信息
// 设置角色/权限信息
JwtToken
jwtToken
=
(
JwtToken
)
principalCollection
.
getPrimaryPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
principalCollection
.
getPrimaryPrincipal
();
...
@@ -92,7 +92,7 @@ public class JwtRealmAppUser extends AuthorizingRealm {
...
@@ -92,7 +92,7 @@ public class JwtRealmAppUser extends AuthorizingRealm {
*/
*/
@Override
@Override
protected
AuthenticationInfo
doGetAuthenticationInfo
(
AuthenticationToken
authenticationToken
)
throws
AuthenticationException
{
protected
AuthenticationInfo
doGetAuthenticationInfo
(
AuthenticationToken
authenticationToken
)
throws
AuthenticationException
{
log
.
debug
(
"doGetAuthenticationInfo authenticationToken..."
);
log
.
info
(
"doGetAuthenticationInfo authenticationToken..."
);
// 校验token
// 校验token
JwtToken
jwtToken
=
(
JwtToken
)
authenticationToken
;
JwtToken
jwtToken
=
(
JwtToken
)
authenticationToken
;
if
(
jwtToken
==
null
)
{
if
(
jwtToken
==
null
)
{
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/service/impl/ShiroLoginServiceImpl.java
View file @
87402a23
...
@@ -105,7 +105,7 @@ public class ShiroLoginServiceImpl implements ShiroLoginService {
...
@@ -105,7 +105,7 @@ public class ShiroLoginServiceImpl implements ShiroLoginService {
// JwtToken newJwtToken = JwtToken.build(newToken, username, jwtToken.getUserId(), salt, expireSecond, jwtToken.getType(), null);
// JwtToken newJwtToken = JwtToken.build(newToken, username, jwtToken.getUserId(), salt, expireSecond, jwtToken.getType(), null);
// // 更新redis缓存
// // 更新redis缓存
// sysLoginRedisService.refreshLoginInfo(token, username, newJwtToken);
// sysLoginRedisService.refreshLoginInfo(token, username, newJwtToken);
// log.
debug
("刷新token成功,原token:{},新token:{}", token, newToken);
// log.
info
("刷新token成功,原token:{},新token:{}", token, newToken);
// // 设置响应头
// // 设置响应头
// // 刷新token
// // 刷新token
// httpServletResponse.setStatus(CommonConstant.JWT_REFRESH_TOKEN_CODE);
// httpServletResponse.setStatus(CommonConstant.JWT_REFRESH_TOKEN_CODE);
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/util/JwtTokenUtil.java
View file @
87402a23
...
@@ -39,7 +39,7 @@ public class JwtTokenUtil {
...
@@ -39,7 +39,7 @@ public class JwtTokenUtil {
public
JwtTokenUtil
(
JwtProperties
jwtProperties
)
{
public
JwtTokenUtil
(
JwtProperties
jwtProperties
)
{
tokenName
=
jwtProperties
.
getTokenName
();
tokenName
=
jwtProperties
.
getTokenName
();
log
.
debug
(
"tokenName:{}"
,
tokenName
);
log
.
info
(
"tokenName:{}"
,
tokenName
);
}
}
/**
/**
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/util/JwtUtil.java
View file @
87402a23
...
@@ -79,13 +79,13 @@ public class JwtUtil {
...
@@ -79,13 +79,13 @@ public class JwtUtil {
log
.
error
(
"username不能为空"
);
log
.
error
(
"username不能为空"
);
return
null
;
return
null
;
}
}
log
.
debug
(
"clientId:{}"
,
clientId
);
log
.
info
(
"clientId:{}"
,
clientId
);
// // 如果盐值为空,则使用默认值:666666
// // 如果盐值为空,则使用默认值:666666
// if (StringUtils.isBlank(salt)) {
// if (StringUtils.isBlank(salt)) {
// salt = jwtProperties.getSecret();
// salt = jwtProperties.getSecret();
// }
// }
log
.
debug
(
"salt:{}"
,
salt
);
log
.
info
(
"salt:{}"
,
salt
);
// 过期时间,单位:秒
// 过期时间,单位:秒
Long
expireSecond
;
Long
expireSecond
;
...
@@ -95,9 +95,9 @@ public class JwtUtil {
...
@@ -95,9 +95,9 @@ public class JwtUtil {
}
else
{
}
else
{
expireSecond
=
expireDuration
.
getSeconds
();
expireSecond
=
expireDuration
.
getSeconds
();
}
}
log
.
debug
(
"expireSecond:{}"
,
expireSecond
);
log
.
info
(
"expireSecond:{}"
,
expireSecond
);
Date
expireDate
=
DateUtils
.
addSeconds
(
new
Date
(),
expireSecond
.
intValue
());
Date
expireDate
=
DateUtils
.
addSeconds
(
new
Date
(),
expireSecond
.
intValue
());
log
.
debug
(
"expireDate:{}"
,
expireDate
);
log
.
info
(
"expireDate:{}"
,
expireDate
);
// 生成token
// 生成token
Algorithm
algorithm
=
Algorithm
.
HMAC256
(
salt
);
Algorithm
algorithm
=
Algorithm
.
HMAC256
(
salt
);
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/util/UploadUtil.java
View file @
87402a23
...
@@ -94,13 +94,13 @@ public final class UploadUtil {
...
@@ -94,13 +94,13 @@ public final class UploadUtil {
public
static
void
deleteQuietly
(
String
uploadPath
,
String
saveFileName
)
{
public
static
void
deleteQuietly
(
String
uploadPath
,
String
saveFileName
)
{
File
saveDir
=
new
File
(
uploadPath
);
File
saveDir
=
new
File
(
uploadPath
);
File
saveFile
=
new
File
(
saveDir
,
saveFileName
);
File
saveFile
=
new
File
(
saveDir
,
saveFileName
);
log
.
debug
(
"删除文件:"
+
saveFile
);
log
.
info
(
"删除文件:"
+
saveFile
);
FileUtils
.
deleteQuietly
(
saveFile
);
FileUtils
.
deleteQuietly
(
saveFile
);
}
}
public
static
interface
UploadFileNameHandle
{
public
interface
UploadFileNameHandle
{
/**
/**
* 回调处理接口
* 回调处理接口
*
*
...
...
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/HelloScheduled.java
View file @
87402a23
...
@@ -33,7 +33,7 @@ public class HelloScheduled {
...
@@ -33,7 +33,7 @@ public class HelloScheduled {
*/
*/
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
public
void
hello
()
throws
Exception
{
public
void
hello
()
throws
Exception
{
log
.
debug
(
"HelloScheduled..."
);
log
.
info
(
"HelloScheduled..."
);
}
}
}
}
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