| | |
| | | package com.ruoyi.common.utils.spring;
|
| | |
|
| | | import org.springframework.aop.framework.Advised;
|
| | | import org.springframework.aop.framework.AopContext;
|
| | | import org.springframework.beans.BeansException;
|
| | | import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
| | |
| | | @SuppressWarnings("unchecked")
|
| | | public static <T> T getAopProxy(T invoker)
|
| | | {
|
| | | return (T) AopContext.currentProxy();
|
| | | Object proxy = AopContext.currentProxy();
|
| | | if (((Advised) proxy).getTargetSource().getTargetClass() == invoker.getClass())
|
| | | {
|
| | | return (T) proxy;
|
| | | }
|
| | | return invoker;
|
| | | }
|
| | |
|
| | | /**
|