我正在嘗試使用 @EnableGlobalMethodSecurity 注釋擴展 GlobalMethodSecurityConfiguration。我有一個單獨的配置類,它使用 @EnableWebSecurity 注釋擴展 WebSecurityConfigurerAdapter。如果我將 @EnableGlobalMethodSecurity 放在我的 WebSecurityConfigurerAdapter 上而不是我的 GlobalMethodSecurityConfiguration 類上,我可以在 CglibAopProxy 中看到該方法正在被攔截然后調用。如果我從 WebSecurityConfigurerAdapter 中刪除 @EnableGlobalMethodSecurity 并將其放在 GlobalMethodSecurityConfiguration 上,我將不再看到任何方法攔截。兩種配置是否沖突?有誰知道為什么在配置 GlobalMethodSecurityConfiguration 后我的方法不再被正確調用。我希望通過擴展 GlobalMethodSecurityConfiguration 來實現方法安全性,以便我可以提供自己的處理程序和表達式根。如果需要,我可以提供代碼片段。
添加回答
舉報
0/150
提交
取消