菜单鉴权,网页下拉不鉴权

This commit is contained in:
sxu 2024-09-29 12:16:35 +08:00
parent ec2e96236b
commit 8f772fd0f6
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.common.security.aspect;
import java.lang.reflect.Method;
import java.util.Objects;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
@ -64,11 +65,14 @@ public class PreAuthorizeAspect
JSONArray jsonArray = JSONUtil.parseArray(argStr);
boolean needPermission = true;
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Object obj = jsonArray.getObj(i);
if (Objects.nonNull(obj) && obj instanceof JSONObject) {
JSONObject jsonObject = (JSONObject) obj;
if ("1".equals(jsonObject.getStr("skipPermission"))) {
needPermission = false;
}
}
}
// 注解鉴权
if (needPermission) {