Compare commits

...

2 Commits

@ -1,5 +1,6 @@
package com.ruoyi.pt.controller; package com.ruoyi.pt.controller;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
@ -57,13 +58,22 @@ public class AEventsController extends BaseController {
* @return * @return
*/ */
@GetMapping("/verify") @GetMapping("/verify")
@ApiOperation(value = "登录获取token") @ApiOperation(value = "校验")
public AjaxResult verificationCode() { public AjaxResult verificationCode() {
LocalDate cacheObject = redisCache.getCacheObject("88888888"); // 获取当前日期
if (cacheObject != null) { LocalDate currentDate = LocalDate.now();
return AjaxResult.success(true); // 创建目标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 { } else {
return AjaxResult.success(false); return AjaxResult.success(true);
} }
} }

Loading…
Cancel
Save