From 613c4cf2b3a397edd95b4e58646db0d96ad50419 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Tue, 20 Jul 2021 17:26:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86token=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86websocket=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/common/account/TokenAuthenticationService.java | 2 +- src/main/java/com/xkrs/controller/FirePointController.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java b/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java index 777adb2..0ae8969 100644 --- a/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java +++ b/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java @@ -79,7 +79,7 @@ public class TokenAuthenticationService { /** * 动态设置过期时间 */ - final long EXPIRATIONTIME = 60 * 60 * duration.toDays() * 24_000 ; + final long EXPIRATIONTIME = 60 * 60 * (duration.toDays()+1) * 24_000 ; // 生成JWT String jwt = Jwts.builder() diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index 0890889..4c3eca2 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -207,4 +207,10 @@ public class FirePointController { return firePointService.selectFirePointNumMonth(); } } + + @GetMapping("/websocketTest") + public void websocketTest(@RequestParam("message") String message){ + + WebSocketServer.broadInfo(message); + } }