From 28c643cc4d3142503dfa5234777399586e8364e9 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期六, 30 三月 2019 11:41:36 +0800
Subject: [PATCH] 添加员工服务端bug修复

---
 java110-service/src/main/java/com/java110/service/aop/PageProcessAspect.java |   38 +++++++++++++++++++++++++++++---------
 1 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/java110-service/src/main/java/com/java110/service/aop/PageProcessAspect.java b/java110-service/src/main/java/com/java110/service/aop/PageProcessAspect.java
index b9399c4..241eed0 100644
--- a/java110-service/src/main/java/com/java110/service/aop/PageProcessAspect.java
+++ b/java110-service/src/main/java/com/java110/service/aop/PageProcessAspect.java
@@ -100,12 +100,18 @@
         String url = request.getRequestURL()!=null?request.getRequestURL().toString():"";
         String componentCode = "";
         String componentMethod = "";
-        if(url.contains("callComponent")){
+        if(url.contains("callComponent")){ //缁勪欢澶勭悊
             String []urls = url.split("/");
 
             if(urls.length == 6){
                 componentCode = urls[4];
                 componentMethod = urls[5];
+            }
+        }else if(url.contains("flow")){ //娴佺▼澶勭悊
+            String []urls = url.split("/");
+
+            if(urls.length == 5){
+                componentCode = urls[4];
             }
         }
 
@@ -137,14 +143,8 @@
             return ;
         }
 
-        if(!StringUtil.isNullOrNone(pd.getToken())) {
-            HttpServletResponse response = attributes.getResponse();
-            Cookie cookie = new Cookie(CommonConstant.COOKIE_AUTH_TOKEN, pd.getToken());
-            cookie.setHttpOnly(true);
-            cookie.setPath("/");
-            response.addCookie(cookie);
-            response.flushBuffer();
-        }
+        //鍐檆ookies淇℃伅
+        writeCookieInfo(pd,attributes);
 
     }
 
@@ -178,4 +178,24 @@
         }
         return token;
     }
+
+
+    /**
+     * 鍐檆ookie 淇℃伅
+     * @param pd 椤甸潰灏佽淇℃伅
+     * @param attributes
+     * @throws IOException
+     */
+    private void writeCookieInfo(IPageData pd,ServletRequestAttributes attributes) throws IOException {
+        // 杩欓噷鐩墠鍙啓鍒扮粍浠剁骇鍒紝濡傛灉闇�瑕� 鍐欐垚鏂规硶绾у埆
+        if(!StringUtil.isNullOrNone(pd.getToken()) && "login".equals(pd.getComponentCode())) {
+            HttpServletResponse response = attributes.getResponse();
+            Cookie cookie = new Cookie(CommonConstant.COOKIE_AUTH_TOKEN, pd.getToken());
+            cookie.setHttpOnly(true);
+            cookie.setPath("/");
+            response.addCookie(cookie);
+            response.flushBuffer();
+        }
+
+    }
 }

--
Gitblit v1.8.0