Przeglądaj źródła

删除浏览器缓存

syh 5 lat temu
rodzic
commit
89b47f34ba

+ 8 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -133,10 +133,13 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
             e.printStackTrace();
             ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SERVER_ERROR.getCode());
         } finally {
+            //获得cookie
+            Set<Cookie> coo = webDriver.manage().getCookies();
+            //清除所有的缓存
+            webDriver.manage().deleteAllCookies();
             webDriver.quit();
             return resultMap;
         }
-
     }
     @Override
     public Map<String, Object> createInternal(JSONObject requestJson) {
@@ -362,6 +365,10 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
+            //获得cookie
+            Set<Cookie> coo = webDriver.manage().getCookies();
+            //清除所有的缓存
+            webDriver.manage().deleteAllCookies();
             webDriver.quit();
         }
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

@@ -361,6 +361,10 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
             e.printStackTrace();
         } finally {
 //            HttpUtils.cookieStore.clear();
+            //获得cookie
+            Set<Cookie> coo = webDriver.manage().getCookies();
+            //清除所有的缓存
+            webDriver.manage().deleteAllCookies();
             webDriver.quit();
             service.stop();
         }