| | |
| | | package com.ruoyi.framework.interceptor.impl;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import java.util.concurrent.TimeUnit;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.stereotype.Component;
|
| | | import cn.hutool.core.lang.Validator;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.core.redis.RedisCache;
|
| | | import com.ruoyi.common.filter.RepeatedlyRequestWrapper;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.http.HttpHelper;
|
| | | import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import java.util.concurrent.TimeUnit;
|
| | |
|
| | | /**
|
| | | * 判断请求url和数据是否和上一次相同,
|
| | |
| | | }
|
| | |
|
| | | // body参数为空,获取Parameter的数据
|
| | | if (StringUtils.isEmpty(nowParams))
|
| | | if (Validator.isEmpty(nowParams))
|
| | | {
|
| | | nowParams = JSONObject.toJSONString(request.getParameterMap());
|
| | | }
|
| | |
| | | // 请求地址(作为存放cache的key值)
|
| | | String url = request.getRequestURI();
|
| | |
|
| | | // 唯一值(没有消息头则使用请求地址)
|
| | | String submitKey = request.getHeader(header);
|
| | | if (Validator.isEmpty(submitKey))
|
| | | {
|
| | | submitKey = url;
|
| | | }
|
| | |
|
| | | // 唯一标识(指定key + 消息头)
|
| | | String cache_repeat_key = Constants.REPEAT_SUBMIT_KEY + request.getHeader(header);
|
| | | String cache_repeat_key = Constants.REPEAT_SUBMIT_KEY + submitKey;
|
| | |
|
| | | Object sessionObj = redisCache.getCacheObject(cache_repeat_key);
|
| | | if (sessionObj != null)
|