看起来修好了验证,现在面板访问控制正常了?

Signed-off-by: Chenx221 <chenx221@yandex.com>
This commit is contained in:
Chenx221 2023-06-08 15:33:23 +08:00
parent 82d9daa676
commit bbef8dac7f
3 changed files with 7 additions and 1 deletions

View File

@ -15,11 +15,14 @@
<constructor-arg value="SHA-256"/>
</bean>
<!-- 配置Spring Security -->
<security:http auto-config="true">
<security:csrf disabled="true"/>
<!-- <security:intercept-url pattern="/login" access="permitAll()"/>-->
<security:intercept-url pattern="/dashboard" access="hasRole('admin')"/>
<security:intercept-url pattern="/student/**" access="hasRole('admin')"/>
<security:form-login login-page="/login"
default-target-url="/dashboard"
authentication-failure-handler-ref="customAuthenticationFailureHandler"/>

View File

@ -15,11 +15,14 @@
<constructor-arg value="SHA-256"/>
</bean>
<!-- 配置Spring Security -->
<security:http auto-config="true">
<security:csrf disabled="true"/>
<!-- <security:intercept-url pattern="/login" access="permitAll()"/>-->
<!-- 限制访问↓-->
<security:intercept-url pattern="/dashboard" access="hasRole('admin')"/>
<security:intercept-url pattern="/student/**" access="hasRole('admin')"/>
<!-- 未登录状态下会自动跳转到/login登录页-->
<security:form-login login-page="/login"
default-target-url="/dashboard"
authentication-failure-handler-ref="customAuthenticationFailureHandler"/>