diff --git a/src/main/java/com/quinn/config/SecurityConfig.java b/src/main/java/com/quinn/config/SecurityConfig.java index 86fcf17..1c304d9 100644 --- a/src/main/java/com/quinn/config/SecurityConfig.java +++ b/src/main/java/com/quinn/config/SecurityConfig.java @@ -58,7 +58,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // http.requiresChannel().anyRequest().requiresSecure(); // 记住我配置 默认为remember-me - http.rememberMe(); + http.rememberMe().tokenValiditySeconds(604800); } // 用户授权验证 diff --git a/src/main/java/com/quinn/service/impl/BlogServiceImpl.java b/src/main/java/com/quinn/service/impl/BlogServiceImpl.java index 73ad343..1288694 100644 --- a/src/main/java/com/quinn/service/impl/BlogServiceImpl.java +++ b/src/main/java/com/quinn/service/impl/BlogServiceImpl.java @@ -57,13 +57,14 @@ public class BlogServiceImpl extends ServiceImpl implements Bl } private void addRecord(BlogWithUser blogRead, String sessionId) { - String value = redisUtils.get(sessionId + blogRead.getBid()); + String bid = blogRead.getBid(); + String value = redisUtils.get(sessionId + bid); Blog blog = new Blog(); - blog.setBid(blogRead.getBid()); if (!QuinnConstant.SESSION_VIEW_KEY.equals(value)){ blog.setViews(blogRead.getViews()+1); - redisUtils.set(sessionId + blog.getBid(),QuinnConstant.SESSION_VIEW_KEY,QuinnConstant.SESSION_TIME_OUT); - updateById(blog); + blogRead.setViews(blogRead.getViews()+1); + redisUtils.set(sessionId + bid,QuinnConstant.SESSION_VIEW_KEY,QuinnConstant.SESSION_TIME_OUT); + update(blog,new QueryWrapper().eq("bid",bid)); } } diff --git a/src/main/java/com/quinn/service/impl/SourceServiceImpl.java b/src/main/java/com/quinn/service/impl/SourceServiceImpl.java index e14d6c5..24ed8ae 100644 --- a/src/main/java/com/quinn/service/impl/SourceServiceImpl.java +++ b/src/main/java/com/quinn/service/impl/SourceServiceImpl.java @@ -196,9 +196,12 @@ public class SourceServiceImpl extends ServiceImpl impleme */ String value = redisUtils.get(sessionId + source.getSid()); if (!QuinnConstant.SESSION_VIEW_KEY.equals(value)){ - source.setDownRecord(source.getDownRecord() + 1); + Source update = new Source(); + update.setId(source.getId()); + update.setDownRecord(source.getDownRecord() + 1); redisUtils.set(sessionId + source.getSid(),QuinnConstant.SESSION_VIEW_KEY,QuinnConstant.SESSION_TIME_OUT); - updateById(source); + // 不更新大字段 + updateById(update); } } diff --git a/src/main/resources/static/wangedit/js/wang.init.js b/src/main/resources/static/wangedit/js/wang.init.js index 4836d40..a393a44 100644 --- a/src/main/resources/static/wangedit/js/wang.init.js +++ b/src/main/resources/static/wangedit/js/wang.init.js @@ -1,6 +1,6 @@ /* 如果使用该初始化方法,请一定要在html放三个标签,或者直接看代码修改内容 *
-*
+*
* * 另外此方法依赖layer.js & axios.js 做遮罩弹框, * 也可以重写 uploadImage:onFailed | onError 自定义提示 @@ -13,7 +13,7 @@ E.i18nChangeLanguage(LANG) const editorConfig = { placeholder: '请输入...', - scroll: true, // 禁止编辑器滚动 + scroll: false, // 禁止编辑器滚动 MENU_CONF: { uploadImage: { fieldName: 'your-fileName', diff --git a/src/main/resources/static/wangedit/js/wang.read.js b/src/main/resources/static/wangedit/js/wang.read.js index a85a896..dca44b7 100644 --- a/src/main/resources/static/wangedit/js/wang.read.js +++ b/src/main/resources/static/wangedit/js/wang.read.js @@ -1,6 +1,6 @@ /* 如果使用该初始化方法,请一定要在html放三个标签,或者直接看代码修改内容 *
-*
+*
* * 另外此方法依赖layer.js & axios.js 做遮罩弹框, * 也可以重写 uploadImage:onFailed | onError 自定义提示 @@ -14,7 +14,7 @@ E.i18nChangeLanguage(LANG) const editorConfig = { placeholder: '', readOnly: true, - scroll: true, // 禁止编辑器滚动 + scroll: false, // 禁止编辑器滚动 } // 先创建 editor diff --git a/src/main/resources/templates/blog/editor.html b/src/main/resources/templates/blog/editor.html index 9f2f433..a353f0b 100644 --- a/src/main/resources/templates/blog/editor.html +++ b/src/main/resources/templates/blog/editor.html @@ -50,7 +50,7 @@

论坛详情

-
+
diff --git a/src/main/resources/templates/blog/read.html b/src/main/resources/templates/blog/read.html index 72d163d..53b6014 100644 --- a/src/main/resources/templates/blog/read.html +++ b/src/main/resources/templates/blog/read.html @@ -96,7 +96,7 @@
-
+
diff --git a/src/main/resources/templates/blog/write.html b/src/main/resources/templates/blog/write.html index 8062d07..aa81e2f 100644 --- a/src/main/resources/templates/blog/write.html +++ b/src/main/resources/templates/blog/write.html @@ -50,7 +50,7 @@

文章内容

-
+
diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index 38aaf3c..5771b14 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -27,7 +27,7 @@
diff --git a/src/main/resources/templates/source/editorSource.html b/src/main/resources/templates/source/editorSource.html index 9483c46..a1c0b0d 100644 --- a/src/main/resources/templates/source/editorSource.html +++ b/src/main/resources/templates/source/editorSource.html @@ -79,7 +79,7 @@
-
+
diff --git a/src/main/resources/templates/source/list.html b/src/main/resources/templates/source/list.html index 85a0504..98eea8c 100644 --- a/src/main/resources/templates/source/list.html +++ b/src/main/resources/templates/source/list.html @@ -8,7 +8,7 @@