From aeb3af81fa992a98a328b77980a2bc45d5619c72 Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Fri, 5 Mar 2021 18:58:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E9=99=86=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=A4=B1=E6=95=88=EF=BC=8C=E6=94=B9=E8=BF=87=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9A=82=E6=97=B6=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 登陆验证失效,改过的代码暂时回退 --- .../io/metersphere/commons/utils/ShiroUtils.java | 2 +- .../io/metersphere/security/ApiKeyFilter.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java index 5a5e1f222b..e48a56c994 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java @@ -41,7 +41,7 @@ public class ShiroUtils { //api-对外文档页面提供的查询接口 filterChainDefinitionMap.put("/api/document/**", "anon"); - filterChainDefinitionMap.put("/document/**", "anon"); +// filterChainDefinitionMap.put("/document/**", "anon"); } public static Cookie getSessionIdCookie(){ diff --git a/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java b/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java index f6de8b3f27..6ac904e70b 100644 --- a/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java +++ b/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java @@ -16,14 +16,14 @@ public class ApiKeyFilter extends AnonymousFilter { @Override protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) { try { - try{ - //这部分代码是为了测试打包完成之后能否访问文档相关路径,封版之前要删除 - HttpServletRequest httpServlet = WebUtils.toHttp(request); - String url = httpServlet.getRequestURL().toString(); - LogUtil.info("Url message : "+url); - }catch (Exception e){ - - } +// try{ +// //这部分代码是为了测试打包完成之后能否访问文档相关路径,封版之前要删除 +// HttpServletRequest httpServlet = WebUtils.toHttp(request); +// String url = httpServlet.getRequestURL().toString(); +// LogUtil.info("Url message : "+url); +// }catch (Exception e){ +// +// } if (!SecurityUtils.getSubject().isAuthenticated()) { String userId = ApiKeyHandler.getUser(WebUtils.toHttp(request));