Commit 448f2dae authored by gary's avatar gary

修复token中不允许有空字符串的bug

parent d17fa4b4
package pwc.taxtech.atms.security; package pwc.taxtech.atms.security;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
...@@ -9,13 +10,12 @@ import pwc.taxtech.atms.dao.PermissionMapper; ...@@ -9,13 +10,12 @@ import pwc.taxtech.atms.dao.PermissionMapper;
import pwc.taxtech.atms.dao.RolePermissionMapper; import pwc.taxtech.atms.dao.RolePermissionMapper;
import pwc.taxtech.atms.dao.UserRoleMapper; import pwc.taxtech.atms.dao.UserRoleMapper;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.service.impl.RoleServiceImpl;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
...@@ -67,7 +67,7 @@ public class JwtAuthenticationService { ...@@ -67,7 +67,7 @@ public class JwtAuthenticationService {
List<Permission> permissions = permissionMapper.selectByExample(permissionExample); List<Permission> permissions = permissionMapper.selectByExample(permissionExample);
permissions.forEach(permission -> { permissions.forEach(permission -> {
apiAuthList.addAll(Arrays.asList(permission.getOperationPermList().split("\\|"))); apiAuthList.addAll(Arrays.stream(permission.getOperationPermList().split("\\|")).filter(p -> StringUtils.isNotBlank(p)).collect(Collectors.toList()));
}); });
/*apiAuthList.add("user:add"); /*apiAuthList.add("user:add");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment