mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
update 优化 脱敏增加角色及权限校验
This commit is contained in:
parent
a619d2de51
commit
b81b4f658d
@ -22,19 +22,19 @@ public class SysSensitiveServiceImpl implements SensitiveService {
|
||||
* 是否脱敏
|
||||
*/
|
||||
@Override
|
||||
public boolean isSensitive(String roleKey,String perms) {
|
||||
if (!StpUtil.isLogin()){
|
||||
public boolean isSensitive(String roleKey, String perms) {
|
||||
if (!StpUtil.isLogin()) {
|
||||
return true;
|
||||
}
|
||||
boolean roleExist = StringUtils.isNotEmpty(roleKey);
|
||||
boolean permsExist = StringUtils.isNotEmpty(perms);
|
||||
if (roleExist && permsExist){
|
||||
if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)){
|
||||
if (roleExist && permsExist) {
|
||||
if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)) {
|
||||
return false;
|
||||
}
|
||||
}else if (roleExist && StpUtil.hasRole(roleKey)){
|
||||
} else if (roleExist && StpUtil.hasRole(roleKey)) {
|
||||
return false;
|
||||
}else if (permsExist && StpUtil.hasPermission(perms)){
|
||||
} else if (permsExist && StpUtil.hasPermission(perms)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user