|
|
@@ -52,7 +52,7 @@ public class UserRealm extends AuthorizingRealm {
|
|
|
*/
|
|
|
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken)
|
|
|
throws AuthenticationException {
|
|
|
-
|
|
|
+ System.out.println("进入登陆授权");
|
|
|
ShiroToken token = (ShiroToken) authcToken;
|
|
|
if (null == token.getType()) {
|
|
|
Admin admin = adminService.selectByMobile(token.getUsername(),"超级管理员");
|
|
|
@@ -86,14 +86,14 @@ public class UserRealm extends AuthorizingRealm {
|
|
|
*/
|
|
|
@Override
|
|
|
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
|
|
|
+ System.out.println("进入角色授权");
|
|
|
int type=TokenManager.getUserType();
|
|
|
+ System.out.println(type);
|
|
|
String userId = TokenManager.getAdminId();
|
|
|
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
|
|
// 根据用户ID查询角色(role),放入到Authorization里。
|
|
|
- System.out.println(type);
|
|
|
if (type==3) {
|
|
|
Set<String> roles = skjtUserMapper.findRoleByUserId(userId);
|
|
|
- System.out.println(roles);
|
|
|
info.setRoles(roles);
|
|
|
// 根据用户ID查询权限(permission),放入到Authorization里。
|
|
|
Set<String> permissions = skjtUserMapper.findPermissionByUserId(userId);
|