From 7aa46fceec7020b5d2b16a712fedd61d9bf3f65b Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 3 Aug 2022 11:15:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=97=B6?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8B=A6=E6=88=AA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015603 --user=刘瑞斌 【系统设置】创建项目接口工作空间ID为空可成功创建 https://www.tapd.cn/55049933/s/1218162 --- .../security/MsPermissionAnnotationMethodInterceptor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/security/MsPermissionAnnotationMethodInterceptor.java b/backend/src/main/java/io/metersphere/security/MsPermissionAnnotationMethodInterceptor.java index 367ed7b2de..9a452f0ec2 100644 --- a/backend/src/main/java/io/metersphere/security/MsPermissionAnnotationMethodInterceptor.java +++ b/backend/src/main/java/io/metersphere/security/MsPermissionAnnotationMethodInterceptor.java @@ -3,6 +3,7 @@ package io.metersphere.security; import io.metersphere.commons.utils.SessionUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.reflect.MethodUtils; import org.apache.shiro.aop.AnnotationResolver; import org.apache.shiro.aop.MethodInvocation; @@ -64,7 +65,7 @@ public class MsPermissionAnnotationMethodInterceptor extends PermissionAnnotatio return false; } //获取这个类的所有属性 - Field[] fields = obj.getClass().getDeclaredFields(); + Field[] fields = FieldUtils.getAllFields(obj.getClass()); boolean flag = false; //循环遍历所有的fields for (Field field : fields) {