优化代码
This commit is contained in:
@ -52,7 +52,7 @@ public class LogAspect
|
||||
* 处理请求前执行
|
||||
*/
|
||||
@Before(value = "@annotation(controllerLog)")
|
||||
public void boBefore(JoinPoint joinPoint, Log controllerLog)
|
||||
public void doBefore(JoinPoint joinPoint, Log controllerLog)
|
||||
{
|
||||
TIME_THREADLOCAL.set(System.currentTimeMillis());
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class SysPermissionService
|
||||
// 多角色设置permissions属性,以便数据权限匹配权限
|
||||
for (SysRole role : roles)
|
||||
{
|
||||
if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL))
|
||||
if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
|
||||
{
|
||||
Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
||||
role.setPermissions(rolePerms);
|
||||
|
@ -120,6 +120,7 @@ public class TokenService
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put(Constants.LOGIN_USER_KEY, token);
|
||||
claims.put(Constants.JWT_USERNAME, loginUser.getUsername());
|
||||
return createToken(claims);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user