优化Feign拦截器,增加userid参数
This commit is contained in:
+6
@@ -40,6 +40,12 @@ public class FeignInterceptorConfig {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//传递userid
|
||||||
|
String userid = request.getHeader(SecurityConstants.USER_ID_HEADER);
|
||||||
|
if (StrUtil.isNotEmpty(userid)) {
|
||||||
|
template.header(SecurityConstants.USER_ID_HEADER, userid);
|
||||||
|
}
|
||||||
|
|
||||||
//传递username
|
//传递username
|
||||||
String username = request.getHeader(SecurityConstants.USER_HEADER);
|
String username = request.getHeader(SecurityConstants.USER_HEADER);
|
||||||
if (StrUtil.isNotEmpty(username)) {
|
if (StrUtil.isNotEmpty(username)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user