From 1b81b84edaeea9b200c622e4a34c49b4b1aaac92 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 06 三月 2025 15:28:19 +0800 Subject: [PATCH] 修改bug和漏洞修复 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java index 27ccbfa..e6d49d2 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java @@ -344,17 +344,29 @@ @ApiOperation(value = "购买会员", tags = {"小程序-个人中心"}) @GetMapping("/vipInfo/pay") public Object vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType, - @RequestParam("payType") Integer payType - ) { - + @RequestParam("payType") Integer payType) { + + LocalDateTime now = LocalDateTime.now(); TVip byId = vipService.getById(vipId); if (byId==null){ return R.ok("当前会员不存在,请刷新后重试。"); } + if(byId.getReveal() == 0){ + return R.ok("无效的会员"); + } + if(1 == buyType && byId.getMonthlyCardDiscountReveal() == 0){ + return R.ok("无效的会员"); + } + if(2 == buyType && byId.getSeasonCardDiscountReveal() == 0){ + return R.ok("无效的会员"); + } + if(3 == buyType && byId.getAnnualCardReveal() == 0){ + return R.ok("无效的会员"); + } + BigDecimal payMoney = BigDecimal.ZERO; BigDecimal discountMoney = BigDecimal.ZERO; BigDecimal discount = BigDecimal.ZERO; - LocalDateTime now = LocalDateTime.now(); switch (buyType){ case 1: if (byId.getMonthlyCardDiscountStart()!=null&&(now.isAfter(byId.getMonthlyCardDiscountStart())&&now.isBefore(byId.getMonthlyCardDiscountEnd()))){ -- Gitblit v1.7.1