Skip to content

Commit 94563a8

Browse files
committed
优化Feign拦截器,增加userid参数
1 parent c72aeaa commit 94563a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

zlt-commons/zlt-ribbon-spring-boot-starter/src/main/java/com/central/common/ribbon/config/FeignInterceptorConfig.java

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public RequestInterceptor requestInterceptor() {
4040
}
4141
*/
4242

43+
//传递userid
44+
String userid = request.getHeader(SecurityConstants.USER_ID_HEADER);
45+
if (StrUtil.isNotEmpty(userid)) {
46+
template.header(SecurityConstants.USER_ID_HEADER, userid);
47+
}
48+
4349
//传递username
4450
String username = request.getHeader(SecurityConstants.USER_HEADER);
4551
if (StrUtil.isNotEmpty(username)) {

0 commit comments

Comments
 (0)