Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
街头小贩
jforum
提交
98cc0435
J
jforum
项目概览
街头小贩
/
jforum
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jforum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
98cc0435
编写于
10月 11, 2020
作者:
街头小贩
提交者:
Gitee
10月 11, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正相关话题的样式
上级
ec0f9889
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
16 deletion
+22
-16
trident/src/main/java/com/apobates/forum/member/storage/ehcache/OnlineMemberEhcacheStorage.java
...um/member/storage/ehcache/OnlineMemberEhcacheStorage.java
+21
-15
trident/src/main/webapp/static/img/core.css
trident/src/main/webapp/static/img/core.css
+1
-1
未找到文件。
trident/src/main/java/com/apobates/forum/member/storage/ehcache/OnlineMemberEhcacheStorage.java
浏览文件 @
98cc0435
...
...
@@ -13,7 +13,10 @@ import com.apobates.forum.utils.CookieUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.cache.jcache.JCacheCacheManager
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PreDestroy
;
import
javax.cache.Cache
;
import
javax.cache.CacheManager
;
import
javax.cache.configuration.MutableConfiguration
;
...
...
@@ -39,32 +42,31 @@ public class OnlineMemberEhcacheStorage implements OnlineMemberStorage {
private
final
static
String
EHC_STORE
=
"olMemberSession"
;
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
OnlineMemberEhcacheStorage
.
class
);
//使用PostConstruct会执行两次
//使用spring的init-method只会执行一次
@PostConstruct
public
void
init
(){
logger
.
info
(
"OnlineMemberEhcacheStorage postconstruct init"
);
MutableConfiguration
<
String
,
MemberSessionBean
>
configuration
=
new
MutableConfiguration
<
String
,
MemberSessionBean
>()
.
setTypes
(
String
.
class
,
MemberSessionBean
.
class
)
.
setStoreByValue
(
true
)
.
setExpiryPolicyFactory
(
CreatedExpiryPolicy
.
factoryOf
(
Duration
.
ONE_DAY
));
MutableConfiguration
<
String
,
MemberSessionBean
>
configuration
=
new
MutableConfiguration
<
String
,
MemberSessionBean
>()
.
setTypes
(
String
.
class
,
MemberSessionBean
.
class
)
.
setStoreByValue
(
true
)
.
setExpiryPolicyFactory
(
CreatedExpiryPolicy
.
factoryOf
(
Duration
.
ONE_DAY
));
try
{
cacheManager
.
getCacheManager
().
createCache
(
EHC_STORE
,
configuration
);
}
catch
(
Exception
e
){
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][init]"
+
e
.
getMessage
(),
e
);
}
e
.
printStackTrace
();
}
}
//销毁
public
void
destroy
(){
try
{
@PreDestroy
public
void
close
(){
logger
.
info
(
"OnlineMemberEhcacheStorage postconstruct close"
);
try
{
cacheManager
.
getCacheManager
().
destroyCache
(
EHC_STORE
);
}
catch
(
Exception
e
){
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][destroy]"
+
e
.
getMessage
(),
e
);
}
e
.
printStackTrace
();
}
}
@Override
public
void
store
(
MemberSessionBean
memberSessionBean
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
passStub
=
rndStub
();
...
...
@@ -79,6 +81,7 @@ public class OnlineMemberEhcacheStorage implements OnlineMemberStorage {
try
{
cache
.
put
(
ecKey
,
memberSessionBean
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][save]"
+
e
.
getMessage
(),
e
);
}
...
...
@@ -97,6 +100,7 @@ public class OnlineMemberEhcacheStorage implements OnlineMemberStorage {
try
{
cache
.
remove
(
ecKey
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][del]"
+
e
.
getMessage
(),
e
);
}
...
...
@@ -127,6 +131,7 @@ public class OnlineMemberEhcacheStorage implements OnlineMemberStorage {
MemberSessionBean
msb
=
cache
.
get
(
ecKey
);
return
Optional
.
ofNullable
(
msb
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][get]"
+
e
.
getMessage
(),
e
);
}
...
...
@@ -147,6 +152,7 @@ public class OnlineMemberEhcacheStorage implements OnlineMemberStorage {
MemberSessionBean
msb
=
cache
.
get
(
ecKey
);
cache
.
put
(
ecKey
,
msb
.
refact
(
group
,
role
,
status
));
}
catch
(
Exception
e
){
e
.
printStackTrace
();
if
(
logger
.
isDebugEnabled
()){
logger
.
debug
(
"[OM][EHC][refresh]"
+
e
.
getMessage
(),
e
);
}
...
...
trident/src/main/webapp/static/img/core.css
浏览文件 @
98cc0435
...
...
@@ -70,7 +70,7 @@ dt{font-weight:500}
.posts-buttons
a
:hover
span
{
opacity
:
1
;}
.posts-member
{
height
:
50px
;
padding-top
:
30px
;}
#scroll-top-section-bar
{
-moz-box-shadow
:
0px
5px
3px
rgba
(
26
,
26
,
26
,
.1
);
-webkit-box-shadow
:
0
5px
3px
rgba
(
26
,
26
,
26
,
.1
);
box-shadow
:
0
5px
3px
rgba
(
26
,
26
,
26
,
.1
);}
.relate_topic
p
{
line-height
:
45px
;
margin
:
0
;
padding
:
0
;
text-indent
:
20px
}
.relate_topic
li
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
line-height
:
35px
;
height
:
35px
;
width
:
49.888%
;
display
:
inline-block
;
text-indent
:
20px
}
.relate_topic
li
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
line-height
:
35px
;
height
:
35px
;
width
:
49.888%
;
display
:
inline-block
;
text-indent
:
20px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
}
#topic_tages
{
margin-bottom
:
15px
}
#topic_tages
label
{
border
:
1px
solid
transparent
;
padding
:
5px
8px
;
display
:
inline
;
font-weight
:
500
}
#topic_tages
a
{
margin-right
:
5px
;
padding
:
5px
8px
;
font-style
:
normal
;}
.tag-item-anchor
{
cursor
:
pointer
}
.tag-item-remove
{
display
:
inline-block
;
padding
:
0
5px
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录