From b796a1a839a523b86c5c889657490c1f09f40b0d Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Thu, 16 Apr 2020 10:06:36 +0800 Subject: [PATCH] update --- .../java/com/yutou/tools/other/tools.java | 35 + web/html/body/nas.html | 24 +- web/html/footer.html | 17 + web/html/header.html | 46 + web/index.html | 59 +- web/js/jquery-3.2.1.js | 10253 ++++++++++++++++ 6 files changed, 10383 insertions(+), 51 deletions(-) create mode 100644 src/main/java/com/yutou/tools/other/tools.java create mode 100644 web/html/footer.html create mode 100644 web/html/header.html create mode 100644 web/js/jquery-3.2.1.js diff --git a/src/main/java/com/yutou/tools/other/tools.java b/src/main/java/com/yutou/tools/other/tools.java new file mode 100644 index 0000000..47cd69a --- /dev/null +++ b/src/main/java/com/yutou/tools/other/tools.java @@ -0,0 +1,35 @@ +package com.yutou.tools.other; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; + +@Controller +public class tools { + + @ResponseBody + @RequestMapping(value = "tools/cookie.do",method = RequestMethod.POST) + public String cookieToJson(HttpServletRequest request){ + JSONObject json=new JSONObject(); + JSONArray array=new JSONArray(); + for (Cookie cookie : request.getCookies()) { + JSONObject item=new JSONObject(); + item.put("name",cookie.getName()); + item.put("value",cookie.getValue()); + item.put("domain",cookie.getDomain()); + item.put("path",cookie.getPath()); + item.put("maxAge",cookie.getMaxAge()); + item.put("secure",cookie.getSecure()); + item.put("isHttpOnly",cookie.isHttpOnly()); + array.add(item); + } + json.put("data",array); + return json.toJSONString(); + } +} diff --git a/web/html/body/nas.html b/web/html/body/nas.html index f0ac369..4513757 100644 --- a/web/html/body/nas.html +++ b/web/html/body/nas.html @@ -7,18 +7,38 @@