| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Aspect |
| | | @Component |
| | | public class LogAop { |
| | | |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @Pointcut(value = "@annotation(com.stylefeng.guns.core.common.annotion.BussinessLog)") |
| | | public void cutService() { |
| | | } |
| | | |
| | | |
| | | @Around("cutService()") |
| | | public Object recordSysLog(ProceedingJoinPoint point) throws Throwable { |
| | | |
| | | |
| | | //先执行业务 |
| | | Object result = point.proceed(); |
| | | |
| | |
| | | String methodName = currentMethod.getName(); |
| | | |
| | | //如果当前用户未登录,不做日志 |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | if (null == user) { |
| | | return; |
| | | } |