From 3d5da3e3ffdd22dad26adaf02586c0bbeaa44b6d Mon Sep 17 00:00:00 2001 From: huqingchun Date: Sat, 25 Nov 2023 09:37:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=90=8E=EF=BC=8C=E7=A7=9F=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=9B=B4=E6=94=B9=E8=B5=84=E6=96=99=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=BC=82=E5=B8=B8,=E5=89=8D=E5=8F=B0=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E5=B2=97=E4=BD=8D=E5=8F=82=E6=95=B0=E4=B8=BAnull?= =?UTF-8?q?=E6=97=B6=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=9C=AC=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E5=8F=B0=E5=A2=9E=E5=8A=A0=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E5=88=9B=E5=BB=BA=E7=A9=BA=E9=9B=86=E5=90=88=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20#I8910U=20:=20https://gitee.com/zhijiantianya/yudao-cloud/is?= =?UTF-8?q?sues/I8910U?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/system/service/user/AdminUserServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index dbfc02ed3..ce946f61c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -118,6 +118,9 @@ public class AdminUserServiceImpl implements AdminUserService { Set dbPostIds = convertSet(userPostMapper.selectListByUserId(userId), UserPostDO::getPostId); // 计算新增和删除的岗位编号 Set postIds = updateObj.getPostIds(); + if (postIds==null) { + postIds = new LinkedHashSet<>(); + } Collection createPostIds = CollUtil.subtract(postIds, dbPostIds); Collection deletePostIds = CollUtil.subtract(dbPostIds, postIds); // 执行新增和删除。对于已经授权的菜单,不用做任何处理 From 4d1b239e4ff437180fe61d943f833f20626e1590 Mon Sep 17 00:00:00 2001 From: huqingchun Date: Sat, 25 Nov 2023 10:08:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#I8I2EW=20=E4=BF=AE=E5=A4=8D@PermitAll?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98,=20?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=9A@PermitAll=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84@RequestMapping=E6=9C=AA=E6=8C=87?= =?UTF-8?q?=E5=AE=9Amethod=E6=97=B6=EF=BC=8CPermitAll=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=8C=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=EF=BC=9A=E6=9C=AA=E6=8C=87=E5=AE=9Amethod?= =?UTF-8?q?=E6=97=B6=E5=B0=864=E4=B8=AA=E8=AF=B7=E6=B1=82=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=9D=87=E5=8A=A0=E5=85=A5result=20=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/YudaoWebSecurityConfigurerAdapter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 24ba15ac0..08f3c505a 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -17,6 +17,7 @@ import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; @@ -160,8 +161,16 @@ public class YudaoWebSecurityConfigurerAdapter { continue; } Set urls = entry.getKey().getPatternsCondition().getPatterns(); + //未指定请求方法则将4个Restful方法均添加到 result 结果 + Set methods = entry.getKey().getMethodsCondition().getMethods(); + if (methods.isEmpty()) { + result.putAll(HttpMethod.GET, urls); + result.putAll(HttpMethod.POST, urls); + result.putAll(HttpMethod.PUT, urls); + result.putAll(HttpMethod.DELETE, urls); + } // 根据请求方法,添加到 result 结果 - entry.getKey().getMethodsCondition().getMethods().forEach(requestMethod -> { + methods.forEach(requestMethod -> { switch (requestMethod) { case GET: result.putAll(HttpMethod.GET, urls);