mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-05-07 22:27:56 +08:00
fix:优化传递token bug
This commit is contained in:
parent
25cdfc3e55
commit
2c20e7baa0
@ -32,8 +32,13 @@ public class SaTokenDubboConsumerFilter implements Filter {
|
|||||||
RpcContext.getContext().setAttachment(SaIdUtil.ID_TOKEN, SaIdUtil.getToken());
|
RpcContext.getContext().setAttachment(SaIdUtil.ID_TOKEN, SaIdUtil.getToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. 调用前,向下传递会话Token
|
// 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. 开始调用
|
// 2. 开始调用
|
||||||
Result invoke = invoker.invoke(invocation);
|
Result invoke = invoker.invoke(invocation);
|
||||||
|
Loading…
Reference in New Issue
Block a user