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
|
@Override
|
||||||
public boolean isSensitive(String roleKey,String perms) {
|
public boolean isSensitive(String roleKey, String perms) {
|
||||||
if (!StpUtil.isLogin()){
|
if (!StpUtil.isLogin()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean roleExist = StringUtils.isNotEmpty(roleKey);
|
boolean roleExist = StringUtils.isNotEmpty(roleKey);
|
||||||
boolean permsExist = StringUtils.isNotEmpty(perms);
|
boolean permsExist = StringUtils.isNotEmpty(perms);
|
||||||
if (roleExist && permsExist){
|
if (roleExist && permsExist) {
|
||||||
if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)){
|
if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else if (roleExist && StpUtil.hasRole(roleKey)){
|
} else if (roleExist && StpUtil.hasRole(roleKey)) {
|
||||||
return false;
|
return false;
|
||||||
}else if (permsExist && StpUtil.hasPermission(perms)){
|
} else if (permsExist && StpUtil.hasPermission(perms)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user