|
|
@@ -1,10 +1,12 @@ |
|
|
package com.iformall.interceptor; |
|
|
package com.iformall.interceptor; |
|
|
|
|
|
|
|
|
import com.iformall.common.ErrorCode; |
|
|
import com.iformall.common.ErrorCode; |
|
|
|
|
|
import com.iformall.common.RequestConstant; |
|
|
import com.iformall.exception.MallinkException; |
|
|
import com.iformall.exception.MallinkException; |
|
|
import com.iformall.utils.HashUtil; |
|
|
import com.iformall.utils.HashUtil; |
|
|
import com.iformall.utils.IPUtil; |
|
|
import com.iformall.utils.IPUtil; |
|
|
import com.iformall.utils.UrlCheck; |
|
|
import com.iformall.utils.UrlCheck; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.dao.DataAccessException; |
|
|
import org.springframework.dao.DataAccessException; |
|
|
@@ -58,12 +60,18 @@ public class RequestInterceptor extends HandlerInterceptorAdapter { |
|
|
} |
|
|
} |
|
|
StringBuilder sb = new StringBuilder(); |
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
|
|
|
|
sb.append(url); |
|
|
|
|
|
|
|
|
sb.append(url).append("?"); |
|
|
|
|
|
|
|
|
sb.append("method=").append(request.getMethod()).append("&"); |
|
|
sb.append("method=").append(request.getMethod()).append("&"); |
|
|
|
|
|
|
|
|
sb.append("ip=").append(ipaddress).append("&"); |
|
|
sb.append("ip=").append(ipaddress).append("&"); |
|
|
|
|
|
|
|
|
|
|
|
// 加入token,避免同一ip下不同用户签名一致提示重复操作。 |
|
|
|
|
|
String token = request.getHeader(RequestConstant.TOKEN); |
|
|
|
|
|
if (StringUtils.isNotBlank(token)) { |
|
|
|
|
|
sb.append("token=").append(token).append("&"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
final Enumeration parameterNames = request.getParameterNames(); |
|
|
final Enumeration parameterNames = request.getParameterNames(); |
|
|
while (parameterNames.hasMoreElements()) { |
|
|
while (parameterNames.hasMoreElements()) { |
|
|
String key = (String) parameterNames.nextElement(); |
|
|
String key = (String) parameterNames.nextElement(); |
|
|
|