| | |
| | | import org.aspectj.lang.ProceedingJoinPoint;
|
| | | import org.aspectj.lang.annotation.Around;
|
| | | import org.aspectj.lang.annotation.Aspect;
|
| | | import org.springframework.core.annotation.Order;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.web.context.request.RequestContextHolder;
|
| | | import org.springframework.web.context.request.ServletRequestAttributes;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | //客户端接口签名验证
|
| | | @Component
|
| | | @Aspect
|
| | | @Order(2)
|
| | | public class SignValidateAspect {
|
| | | public static final String EDP = "execution(* com.yeshi.fanli.controller.client.*.*(..))";
|
| | |
|
| | |
| | | for (Object obj : args) {
|
| | | if (obj instanceof AcceptData) {
|
| | | acceptData = (AcceptData) obj;
|
| | | } else if (obj instanceof HttpServletRequest) {
|
| | | request = (HttpServletRequest) obj;
|
| | | }
|
| | | }
|
| | | boolean isRight = true;
|
| | |
| | |
|
| | | if ((acceptData.getPlatform() != null && acceptData.getPlatform().equalsIgnoreCase("android")
|
| | | && acceptData.getVersion() != null && Integer.parseInt(acceptData.getVersion()) > 21)
|
| | | || (acceptData.getPlatform().equalsIgnoreCase("ios") && acceptData.getVersion() != null
|
| | | && Integer.parseInt(acceptData.getVersion()) > 24)) {
|
| | | || (acceptData.getPlatform() != null && acceptData.getPlatform().equalsIgnoreCase("ios")
|
| | | && acceptData.getVersion() != null && Integer.parseInt(acceptData.getVersion()) > 24)) {
|
| | | isRight = signIsRight(request);
|
| | | } else if (acceptData.getPackages().startsWith("com.haicaojie")) {
|
| | | isRight = signIsRight(request);
|
| | |
| | | // out.close();
|
| | | // return null;
|
| | | // }
|
| | | // uid
|
| | |
|
| | | Object obj = null;
|
| | | try {
|