提交 98cc0435 编写于 作者: 街头小贩's avatar 街头小贩 提交者: Gitee

修正相关话题的样式

上级 ec0f9889
......@@ -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);
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册