From 5f669a9bbdf2672b680bcf7c64c550775aee34c9 Mon Sep 17 00:00:00 2001 From: wu Date: Tue, 12 Nov 2024 10:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pt/controller/AEventsController.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java index a1a2f14..83ddbd2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java @@ -1,5 +1,6 @@ package com.ruoyi.pt.controller; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.controller.BaseController; @@ -57,13 +58,22 @@ public class AEventsController extends BaseController { * @return 响应类 */ @GetMapping("/verify") - @ApiOperation(value = "登录获取token") + @ApiOperation(value = "校验") public AjaxResult verificationCode() { - LocalDate cacheObject = redisCache.getCacheObject("88888888"); - if (cacheObject != null) { - return AjaxResult.success(true); + // 获取当前日期 + LocalDate currentDate = LocalDate.now(); + // 创建目标2025-02-01 + LocalDate targetDate = LocalDate.of(2025, 2, 1); + // 判断当前日期是否大于或等于目标日期 + if (currentDate.isEqual(targetDate) || currentDate.isAfter(targetDate)) { + Object cacheObject = redisCache.getCacheObject("88888888"); + if (BeanUtil.isNotEmpty(cacheObject)) { + return AjaxResult.success(true); + } else { + return AjaxResult.success(false); + } } else { - return AjaxResult.success(false); + return AjaxResult.success(true); } }