spring 安全许可全部无效

spring security permitAll not working

我在我的系统中启用了 spring 安全性。我有两个 url,其中一个应该没有安全性(目前)。 这是我的安全部分

<security:intercept-url pattern="/api/admin**"
                        access="permitAll" />
<security:intercept-url pattern="/api/**"
                        access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<security:http-basic />

管理员部分现在无需登录即可使用,但事实并非如此,访问 url:http://localhost:8080/kma/api/admin/accounting/ 仍然需要用户名和密码

尝试<security:intercept-url pattern="/api/admin/**" access="permitAll" />。请注意 admin 之后和 ** 之前的 /

如果没有 /,配置将匹配 /api/admin/api/admin123 等请求