如果我将自定义过滤器jwt添加到shiroFilterFactoryBean
,则urlFilter.put("/helloworld","authc,rolse[user]");
为
无效。
Map<String,Filter> filterMap = new LinkedHashMap<>();
filterMap.put("jwt",new JWTFilter() );
shiroFilterFactoryBean.setFilters(filterMap);
Map<String,String> urlFilter = new LinkedHashMap<>();
urlFilter.put("/user/signin", "anon" );
urlFilter.put("/user/register", "anon" );
urlFilter.put("/**", "jwt" );
urlFilter.put("/helloworld", "authc,rolse[user]");
答案 0 :(得分:0)
顺序很重要,您只需要在地图的末尾粘贴let date = new Date();
console.log('UTC' +
(-date.getTimezoneOffset() < 0 ? '-' : '+') +
(Math.abs(date.getTimezoneOffset() / 60) < 10 ? '0' : '') +
(Math.abs(date.getTimezoneOffset() / 60)) + ':00'
);
,请参阅文档中的相关警告:
https://shiro.apache.org/web.html#web-ini-configuration