mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-06-20 07:22:00 +08:00
【代码优化】全局:userId 为空时,直接校验权限不通过
This commit is contained in:
parent
39bf9cf5b0
commit
aef833fb9f
@ -27,7 +27,11 @@ public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAnyPermissions(String... permissions) {
|
public boolean hasAnyPermissions(String... permissions) {
|
||||||
return permissionApi.hasAnyPermissions(getLoginUserId(), permissions);
|
Long userId = getLoginUserId();
|
||||||
|
if (userId == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return permissionApi.hasAnyPermissions(userId, permissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -37,7 +41,11 @@ public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAnyRoles(String... roles) {
|
public boolean hasAnyRoles(String... roles) {
|
||||||
return permissionApi.hasAnyRoles(getLoginUserId(), roles);
|
Long userId = getLoginUserId();
|
||||||
|
if (userId == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return permissionApi.hasAnyRoles(userId, roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user