| | |
| | | package com.yeshi.buwan.aspect; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.Utils; |
| | |
| | | |
| | | //签名验证 |
| | | @Around("execution(public * com.yeshi.buwan.controller.api.*.*(..))") |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws IOException { |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = servletContainer.getRequest(); |
| | | HttpServletResponse response = servletContainer.getResponse(); |
| | |
| | | for (Object obj : args) { |
| | | if (obj instanceof AcceptData) { |
| | | acceptData = (AcceptData) obj; |
| | | if (acceptData != null) { |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | acceptData.setChannel("appstore"); |
| | | } |
| | | //注入detailSystem |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | acceptData.setDetailSystem(detailSystem); |
| | | } |
| | | |
| | | } else if (obj instanceof PrintWriter) { |
| | | out = (PrintWriter) obj; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | Object obj = null; |
| | | try { |
| | | obj = joinPoint.proceed(args); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | |
| | | if (acceptData != null) { |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | acceptData.setChannel("appstore"); |
| | | } |
| | | if (acceptData.getPackageName().equalsIgnoreCase("com.doudou.ysvideo.lite")) { |
| | | //小米上架使用 |
| | | if (!"xiaomi".equalsIgnoreCase(acceptData.getChannel())) { |
| | | acceptData.setPackageName("com.doudou.ysvideo"); |
| | | acceptData.setChildPackage("com.doudou.ysvideo.lite"); |
| | | } else { |
| | | acceptData.setChildPackage("com.doudou.ysvideo.lite"); |
| | | } |
| | | } else { |
| | | acceptData.setChildPackage(acceptData.getPackage()); |
| | | } |
| | | //注入detailSystem |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | acceptData.setDetailSystem(detailSystem); |
| | | |
| | | detailSystem = systemService.getDetailSystemByPackage(acceptData.getChildPackage()); |
| | | acceptData.setChildDetailSystem(detailSystem); |
| | | } |
| | | return obj; |
| | | |
| | | |
| | | return joinPoint.proceed(args); |
| | | } |
| | | |
| | | |