shiro.ini
[main]
nutzdao_realm = com.je.web.shiro.realm.MyAuthorizingRealm
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManagerConfigFile=classpath:ehcache.xml
nutzdao_realm.cacheManager = $cacheManager
securityManager.realms = $nutzdao_realm
securityManager.cacheManager = $cacheManager
authc = org.nutz.integration.shiro.SimpleAuthenticationFilter
authc.loginUrl = /security/login.mvc
logout.redirectUrl= /security/login.mvc
[urls]
/captcha/* = anon
/security/** = anon
/resources/** = anon
/static/** = anon
按照进阶手册搭起来,亲测可用,引入业务代码后,发现所有shiro的注解@RequiresPermissions都不生效,所有页面的shiro标签<shiro:hasPermission>也不生效,项目启动和运行过程中没有报任何错,求指点。
主入口:
@IocBy(args = {"*js", "ioc/",
"*anno", "com.je",
"*tx",
"*async",
"*quartz",// 添加quartz插件引用
"*jedis"})
@Modules(scanPackage = true)
@SessionBy(ShiroSessionProvider.class) //使用Shiro的Session替换NutFilter作用域内的Session
@Encoding(input = "UTF-8", output = "UTF-8")
@SetupBy(CmsSetup.class)
@ChainBy(args="mvc/mvc-chain.js")
public class CmsModule {}