From c5da6f1ca15bc26d8c08e559812cb08fffe6cb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 21 Oct 2024 13:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E8=AE=A2=E9=98=85=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/controller/product/TbPlaceController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPlaceController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPlaceController.java index 2185f039..e0f24ad0 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPlaceController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPlaceController.java @@ -8,7 +8,11 @@ import cn.ysk.cashier.pojo.order.TbCashierCart; import cn.ysk.cashier.service.product.TbProductService; import cn.ysk.cashier.service.shop.TbShopTableService; import cn.ysk.cashier.utils.RabbitMsgUtils; +import cn.ysk.cashier.utils.RedisUtils; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -18,6 +22,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; +@Slf4j @RestController @RequestMapping("/api/place") public class TbPlaceController { @@ -26,6 +31,9 @@ public class TbPlaceController { private final RabbitMsgUtils rabbitMsgUtils; @Resource private TokenProvider tokenProvider; + @Lazy + @Autowired + private RedisUtils redisUtils; @GetMapping("/activate") @ApiOperation("查询/product") @@ -146,6 +154,8 @@ public class TbPlaceController { public ResponseEntity pay(HttpServletRequest request, @Validated @RequestBody PayDTO payDTO) { String token = tokenProvider.getToken(request); payDTO.setToken(token); + String subject = tokenProvider.getClaims(token).getSubject(); + log.error(">>>>>>>>>>>>>>>>>>>>>>>>>>>>subject:{}", subject); return ResponseEntity.ok(tbShopTableService.pay(payDTO)); }