use of com.luoxiao.model.User in project ssm_shiro_blog by Mandelo.
the class MainController method userManage.
/**
* 角色管理界面
*
* @return
*/
@RequestMapping(value = "/cms/userManage")
public ModelAndView userManage() {
ModelAndView mv = new ModelAndView();
List<User> userList = userService.selectAll();
List<UserRoleTemp> userRoleList = new ArrayList<UserRoleTemp>();
for (User user : userList) {
List<String> roleList = userExtendService.getRoles(user.getUsername());
UserRoleTemp u = new UserRoleTemp();
u.setId(user.getId());
u.setUsername(user.getUsername());
u.setRoles(roleList);
// System.out.println(u);
userRoleList.add(u);
}
mv.addObject("urList", userRoleList);
mv.setViewName("cms/userManage");
return mv;
}
use of com.luoxiao.model.User in project ssm_shiro_blog by Mandelo.
the class MyRealm method doGetAuthenticationInfo.
/**
* 用于验证身份
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String username = (String) token.getPrincipal();
User user = userExtendDao.selectByUsername(username);
if (null != user) {
AuthenticationInfo info = new SimpleAuthenticationInfo(user.getUsername(), user.getPassword(), "xx");
return info;
}
return null;
}
Aggregations