doGetAuthorizationInfo方法不執行
- 在 @Controller 上加入 @RequiresRoles(“admin”)
2.手工調用subject.hasRole(“admin”) 或 subject.isPermitted(“admin”)
3.頁面標籤調用<shiro:hasPermission name=“admin”></shiro:hasPermission>
因爲之前被卡了一波,在這裏,所以寫在前面
這上面這3個方法好像不行。。。
區別:
IGNORE_LOGIN_RESOURCES:沒有登錄也可以訪問
IGNORE_PERMISSION_RESOURCES:登錄後纔可以訪問,登錄後不做權限校驗