NutzCN Logo
问答 如何实现再规定ip范围段内利用nutzboot shiro实现登录功能
发布于 2185天前 作者 shine 1503 次浏览 复制 上一个帖子 下一个帖子
标签:

有个需求,就是需要再规定ip范围内登录,想用shiro登录授权,怎么个思路实现,nutzboot,,,,,,,,,,
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
SimpleShiroToken upToken = (SimpleShiroToken) token;

    User user = dao().fetch(User.class, (Long)upToken.getPrincipal());
    if (user == null)
       return null;
    return new SimpleAccount(user.getId(), user.getPassword(), getName());
}

是在这里实现吗

1 回复

没看到发帖提示?没看到 插入代码 的按钮?

添加回复
请先登陆
回到顶部