|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Around("@within(org.springframework.web.bind.annotation.RestController)" + | 
|---|
|  |  |  | "||@within(org.springframework.stereotype.Controller)") | 
|---|
|  |  |  | public Object after(ProceedingJoinPoint joinPoint) throws Throwable{ | 
|---|
|  |  |  | public Object after(ProceedingJoinPoint joinPoint) throws Throwable { | 
|---|
|  |  |  | ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); | 
|---|
|  |  |  | //if(requestAttributes != null){ | 
|---|
|  |  |  | //    return joinPoint.proceed(); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); | 
|---|
|  |  |  | Method method = signature.getMethod(); | 
|---|
|  |  |  | if (method.isAnnotationPresent(ManagerAuth.class)){ | 
|---|
|  |  |  | if (method.isAnnotationPresent(ManagerAuth.class)) { | 
|---|
|  |  |  | ManagerAuth annotation = method.getAnnotation(ManagerAuth.class); | 
|---|
|  |  |  | if (annotation.value().equals(ManagerAuth.Auth.CHECK)){ | 
|---|
|  |  |  | if (annotation.value().equals(ManagerAuth.Auth.CHECK)) { | 
|---|
|  |  |  | if (!Cools.isEmpty(annotation.memo())) { | 
|---|
|  |  |  | saveLog(joinPoint, request, result,annotation.memo()); | 
|---|
|  |  |  | saveLog(joinPoint, request, result, annotation.memo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | && !(obj instanceof HttpServletRequest)).collect(Collectors.toList()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void saveLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object result,String memo) { | 
|---|
|  |  |  | private void saveLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object result, String memo) { | 
|---|
|  |  |  | Long userId = 9527L; | 
|---|
|  |  |  | String token = request.getHeader("token"); | 
|---|
|  |  |  | UserLogin userLogin = userLoginService.selectOne(new EntityWrapper<UserLogin>().eq("token", token).eq("system", "WMS")); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 记录操作日志 | 
|---|
|  |  |  | OperateLog operateLog = new OperateLog(); | 
|---|
|  |  |  | operateLog.setAction(Cools.isEmpty(memo)?request.getRequestURI():memo); | 
|---|
|  |  |  | operateLog.setAction(Cools.isEmpty(memo) ? request.getRequestURI() : memo); | 
|---|
|  |  |  | operateLog.setIp(request.getRemoteAddr()); | 
|---|
|  |  |  | operateLog.setUserId(userId); | 
|---|
|  |  |  | operateLog.setRequest(JSONObject.toJSONString(filterArgs(joinPoint.getArgs()))); | 
|---|