1234567891011121314151617181920212223242526272829303132333435363738 |
- //package com.imed.costaccount.common.aop;
- //
- //import cn.hutool.core.util.StrUtil;
- //import com.imed.costaccount.common.token.ThreadLocalToken;
- //import com.imed.costaccount.common.util.Result;
- //import lombok.extern.slf4j.Slf4j;
- //import org.aspectj.lang.ProceedingJoinPoint;
- //import org.aspectj.lang.annotation.Around;
- //import org.aspectj.lang.annotation.Aspect;
- //import org.aspectj.lang.annotation.Pointcut;
- //import org.springframework.beans.factory.annotation.Autowired;
- //import org.springframework.stereotype.Component;
- //
- //@Aspect
- //@Component
- //@Slf4j
- //public class TokenAspect {
- //
- // @Autowired
- // private ThreadLocalToken local;
- //
- // @Pointcut("execution(public * com.imed.costaccount.web.*.*(..)))")
- // public void tokenPointCut() {
- //
- // }
- //
- // @Around("tokenPointCut()")
- // public Object tokenAround(ProceedingJoinPoint point) throws Throwable {
- // Result result = (Result) point.proceed();
- // String token = local.getToken();
- // if (StrUtil.isNotBlank(token)) {
- // result.setToken(token);
- // local.clear();
- // return result;
- // }
- // return result;
- // }
- //}
|