shuzheng 9 лет назад
Родитель
Сommit
a9e3f00bcb

+ 5 - 0
cms/cms-web/src/main/resources/applicationContext-security.xml

@@ -6,6 +6,11 @@
         http://www.springframework.org/schema/security
         http://www.springframework.org/schema/security/spring-security.xsd">
 
+	<!-- 不需要控制权限的资源 -->
+	<http security="none" pattern="/resources/**" />
+	<http security="none" pattern="/**/*.html" />
+	<http security="none" pattern="/**/*.jsp" />
+
 	<http use-expressions="false">
 		<!-- 登录页面不需要控制权限 -->
 		<intercept-url pattern="/manage/login" access="IS_AUTHENTICATED_ANONYMOUSLY"/>

+ 1 - 0
cms/cms-web/src/main/webapp/WEB-INF/jsp/user/add.jsp

@@ -19,6 +19,7 @@
 </div>
 <div id="main">
 	<form id="form" method="post">
+	<input type="hidden" name="_csrf" value="${_csrf.token}" />
 	<table border="1">
 		<caption>添加用户</caption>
 		<tr><td>帐号:<font color="#cc0000">*</font></td><td><input id="username" type="text" name="username" placeholder="必填" required="true" maxlength="20" autofocus value=""/></td></tr>

+ 1 - 0
cms/cms-web/src/main/webapp/WEB-INF/jsp/user/update.jsp

@@ -19,6 +19,7 @@
 </div>
 <div id="main">
 	<form id="form" method="post">
+	<input type="hidden" name="_csrf" value="${_csrf.token}" />
 	<table border="1">
 		<caption>修改用户</caption>
 		<tr><td>帐号:<font color="#cc0000">*</font></td><td><input id="username" type="text" name="username" placeholder="必填" required="true" maxlength="20" autofocus value="${user.username}"/></td></tr>

+ 2 - 0
cms/cms-web/src/main/webapp/WEB-INF/web.xml

@@ -53,6 +53,7 @@
 	</servlet-mapping>
 
 	<!-- Spring Security -->
+	<!--
 	<filter>
 		<filter-name>springSecurityFilterChain</filter-name>
 		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
@@ -61,6 +62,7 @@
 		<filter-name>springSecurityFilterChain</filter-name>
 		<url-pattern>/*</url-pattern>
 	</filter-mapping>
+	-->
 
 	<!-- Druid连接池监控页面 -->
 	<servlet>