fix:优化传递token bug

This commit is contained in:
dongchunyu 2021-12-22 15:44:45 +08:00
parent 25cdfc3e55
commit 2c20e7baa0

View File

@ -33,7 +33,12 @@ public class SaTokenDubboConsumerFilter implements Filter {
}
// 1. 调用前向下传递会话Token
RpcContext.getContext().setAttachment(SaTokenConsts.JUST_CREATED, StpUtil.getTokenValueNotCut());
String tokenValueNotCut = null;
try {
tokenValueNotCut = StpUtil.getTokenValueNotCut();
} finally {
RpcContext.getContext().setAttachment(SaTokenConsts.JUST_CREATED, tokenValueNotCut);
}
// 2. 开始调用
Result invoke = invoker.invoke(invocation);