From e90b009c65fc73a99bb2ee827bcd65d9b2b8d525 Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Fri, 26 Aug 2022 09:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/tool/LoginFilter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/LoginFilter.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/LoginFilter.java index 987496f..141b9e3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/LoginFilter.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/LoginFilter.java @@ -16,6 +16,8 @@ import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @Order(1) @@ -36,7 +38,14 @@ public class LoginFilter implements Filter { @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { String currentUrl = ((HttpServletRequest) servletRequest).getServletPath(); - if (!currentUrl.equals("/api/app/hospital/list")) { + List filterUrlList = new ArrayList<>(); + filterUrlList.add("/api/app/hospital/list"); + filterUrlList.add("/api/app/patient/makeAnAppointment"); + filterUrlList.add("/api/app/doctor/info"); + filterUrlList.add("/api/app/patient/info"); + filterUrlList.add("/api/app/patient/modify"); + + if (!filterUrlList.contains(currentUrl)) { LoginUser loginUser = userTokenService.getLoginUser((HttpServletRequest) servletRequest); SysUser user = loginUser.getUser(); TDoctor tDoctor = tDoctorService.selectTDoctorByPhone(user.getPhonenumber());