| | |
| | | package com.ruoyi.framework.aspectj; |
| | | |
| | | import cn.dev33.satoken.SaManager; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.properties.TokenProperties; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.redis.RedisUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | |
| | | @Component |
| | | public class RepeatSubmitAspect { |
| | | |
| | | private final TokenProperties tokenProperties; |
| | | private final RepeatSubmitProperties repeatSubmitProperties; |
| | | |
| | | @Before("@annotation(repeatSubmit)") |
| | |
| | | String url = request.getRequestURI(); |
| | | |
| | | // 唯一值(没有消息头则使用请求地址) |
| | | String submitKey = StringUtils.trimToEmpty(request.getHeader(tokenProperties.getHeader())); |
| | | String submitKey = StringUtils.trimToEmpty(request.getHeader(SaManager.getConfig().getTokenName())); |
| | | |
| | | submitKey = SecureUtil.md5(submitKey + ":" + nowParams); |
| | | // 唯一标识(指定key + url + 消息头) |