更新时间:2023-12-03 20:09:52
一种方法是使用 Spring Security 的 网络安全表达式.例如:
One way you can do this is to use Spring Security's Web Security Expressions. For example:
<http use-expressions="true">
<intercept-url pattern="/admin*"
access="hasRole('admin') and hasIpAddress('192.168.1.0/24')"/>
...
</http>