From 4552ab3d5bcfbabe3ce78e962111a3fe9d44b613 Mon Sep 17 00:00:00 2001 From: mewhz Date: Sat, 6 Nov 2021 15:47:16 +0800 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E7=A0=81=E5=B1=95=E7=A4=BA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=8F=A3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mewhz/paste/controller/ListController.java | 13 ++++++++++--- src/main/resources/static/index.html | 5 ++++- src/main/resources/static/js/index.js | 6 ++++++ src/main/resources/static/js/jquery-3.6.0.min.js | 2 ++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/static/js/index.js create mode 100644 src/main/resources/static/js/jquery-3.6.0.min.js diff --git a/src/main/java/com/mewhz/paste/controller/ListController.java b/src/main/java/com/mewhz/paste/controller/ListController.java index 991c5b2..4a45eea 100644 --- a/src/main/java/com/mewhz/paste/controller/ListController.java +++ b/src/main/java/com/mewhz/paste/controller/ListController.java @@ -13,11 +13,17 @@ * @author mewhz */ @Controller -public class ListController { + +public class ListController { @ResponseBody - @RequestMapping("/list") - public String list(@RequestParam String id){ + @RequestMapping(value = "/list") + public String list(@RequestParam(value = "id", required = false) String id ){ + + if (id == null || "".equals(id)) { + return "

未输入标识码

"; + } + String htmlBegin = "\n" + "\n" + "\n" + @@ -69,4 +75,5 @@ public String list(@RequestParam String id){ return html.toString(); } + } diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 4c153ae..918a61a 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -7,6 +7,8 @@ + +
@@ -23,7 +25,7 @@