修改指定jar里面某个放法的返回值(ProceedingJoinPoint,@Aspect)

拦截某个lib下的jar里面的某个方法,并修改它的返回值:

@Aspect
@Component
public class WeixinAspect {

	@Around("execution(* cn.service.weixin.QyService.getUserId(..))")
	public Object loginAround(ProceedingJoinPoint pjp) throws Throwable {
		String result = (String) pjp.proceed();
                //根据需求修改result的值
		return result;
	}

}
正在加载评论...