From defa5d2033f5faac3663bea9a9f9ce620dc9a55d Mon Sep 17 00:00:00 2001 From: msgroup Date: Fri, 30 Jul 2021 09:46:12 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=99=BB=E5=BD=95=E4=BC=98=E5=8C=96?= =?UTF-8?q?=202=E3=80=81=E6=A0=8F=E7=9B=AE=E8=A1=A8=E5=8D=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96=203=E3=80=81=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/mingsoft/cms/dao/IContentDao.xml | 8 +- .../java/net/mingsoft/config/ShiroConfig.java | 31 ++++- .../WEB-INF/manager/cms/category/form.ftl | 2 +- .../WEB-INF/manager/cms/category/index.ftl | 7 +- .../WEB-INF/manager/cms/generate/index.ftl | 6 +- .../webapp/template/1/default/css/app.css | 4 +- src/main/webapp/template/1/default/search.htm | 128 +++++++++--------- 7 files changed, 106 insertions(+), 80 deletions(-) diff --git a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml index cc07790b..46b61f66 100755 --- a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml +++ b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml @@ -259,18 +259,18 @@ - and content_datetime >= #{beginTime} + AND ct.UPDATE_DATE >= #{beginTime} - and content_datetime >= to_date(#{beginTime}, 'yyyy-mm-dd hh24:mi:ss') + and ct.UPDATE_DATE >= to_date(#{beginTime}, 'yyyy-mm-dd hh24:mi:ss') - and content_datetime >= #{endTime} + and ct.UPDATE_DATE >= #{endTime} - and content_datetime >= to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') + and ct.UPDATE_DATE >= to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') diff --git a/src/main/java/net/mingsoft/config/ShiroConfig.java b/src/main/java/net/mingsoft/config/ShiroConfig.java index 034e0779..b95208a6 100644 --- a/src/main/java/net/mingsoft/config/ShiroConfig.java +++ b/src/main/java/net/mingsoft/config/ShiroConfig.java @@ -20,11 +20,14 @@ */ package net.mingsoft.config; +import cn.hutool.core.codec.Base64; import net.mingsoft.basic.realm.ManagerAuthRealm; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; +import org.apache.shiro.web.mgt.CookieRememberMeManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; +import org.apache.shiro.web.servlet.SimpleCookie; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -97,12 +100,36 @@ public class ShiroConfig { filterChainDefinitionMap.put(managerPath + "/checkLogin.do", "anon"); // 其余接口一律拦截 // 主要这行代码必须放在所有权限设置的最后,不然会导致所有 url 都被拦截 - filterChainDefinitionMap.put(managerPath + "/**", "authc"); + filterChainDefinitionMap.put(managerPath + "/**", "user"); shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); return shiroFilterFactoryBean; } + /** + * cookie对象 + * @return + */ + public SimpleCookie rememberMeCookie() { + // 设置cookie名称,对应login.html页面的 + SimpleCookie cookie = new SimpleCookie("rememberMe"); + // 设置cookie的过期时间,单位为秒,这里为一天 + cookie.setMaxAge(86400); + return cookie; + } + + /** + * cookie管理对象 + * @return + */ + public CookieRememberMeManager rememberMeManager() { + CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); + cookieRememberMeManager.setCookie(rememberMeCookie()); + // rememberMe cookie加密的密钥 + cookieRememberMeManager.setCipherKey(Base64.decode("4AvVhmFLUs0KTA3Kprsdag==")); + return cookieRememberMeManager; + } + /** * 注入 securityManager */ @@ -111,6 +138,8 @@ public class ShiroConfig { DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); // 设置realm. securityManager.setRealm(customRealm()); + //cookie管理配置对象 + securityManager.setRememberMeManager(rememberMeManager()); return securityManager; } diff --git a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl index 5b7904fc..478657a7 100644 --- a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl @@ -57,7 +57,7 @@
列表:列表->详情 的页面,例如:新闻列表、图片列表,可以多篇文章
单篇:单篇文章,例如:关于我们、公司介绍,只能发一篇文章
- 拦截:外链接,需要配合逻辑判断<#if>自定义链接标签使用使用,不能发文章
+ 链接:外链接,需要配合逻辑判断<#if>自定义链接标签使用使用,不能发文章
修改栏目时,如果该栏目下存在文章栏目类型则不能修改
diff --git a/src/main/webapp/WEB-INF/manager/cms/category/index.ftl b/src/main/webapp/WEB-INF/manager/cms/category/index.ftl index 9d39ade1..11d4ee4b 100644 --- a/src/main/webapp/WEB-INF/manager/cms/category/index.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/category/index.ftl @@ -50,7 +50,8 @@ @@ -58,10 +59,6 @@ - - - diff --git a/src/main/webapp/WEB-INF/manager/cms/generate/index.ftl b/src/main/webapp/WEB-INF/manager/cms/generate/index.ftl index d547bf5a..ece43a05 100644 --- a/src/main/webapp/WEB-INF/manager/cms/generate/index.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/generate/index.ftl @@ -311,7 +311,7 @@ padding:20px; outline:none; outline-offset:-1px; - height:400px; + min-height:250px; max-width:100%; background-color:#FFFFFF; flex-direction:column; @@ -459,7 +459,7 @@ padding:20px; outline:none; outline-offset:-1px; - height:300px; + min-height:250px; max-width:100%; background-color:#FFFFFF; flex-direction:column; @@ -604,7 +604,7 @@ padding:20px; outline:none; outline-offset:-1px; - height:300px; + min-height:250px; max-width:100%; background-color:#FFFFFF; flex-direction:column; diff --git a/src/main/webapp/template/1/default/css/app.css b/src/main/webapp/template/1/default/css/app.css index 2e9b46be..123a1ac1 100755 --- a/src/main/webapp/template/1/default/css/app.css +++ b/src/main/webapp/template/1/default/css/app.css @@ -102,7 +102,7 @@ flex-direction: row; display: flex; padding-right: 40px; - width: 50%; + width: 70%; box-sizing: border-box; padding-left: 40px; justify-content: space-between; @@ -777,4 +777,4 @@ font-size: 14px; padding-top: 0px; } -} \ No newline at end of file +} diff --git a/src/main/webapp/template/1/default/search.htm b/src/main/webapp/template/1/default/search.htm index 8b8c14cc..90064223 100755 --- a/src/main/webapp/template/1/default/search.htm +++ b/src/main/webapp/template/1/default/search.htm @@ -1,55 +1,55 @@ - - - {ms:global.name/} - - - - - - - - - - - - - - - - - - - - - + + + {ms:global.name/} + + + + + + + + + + + + + + + + + + + + + + - - -
- <#include "nav.htm" /> - + - \ No newline at end of file +