我正在使用feign(10.0.1)调用微服务,这是我的客户代码:
public class EnvelopOperate {
@Autowired
private IRedEnvelopeController envelopeController;
public void sendEnvelop(Long userId, Long playRoomId, Integer triggerNum) {
SendRedEnvelopeRequest sendRedEnvelopeRequest = new SendRedEnvelopeRequest();
sendRedEnvelopeRequest.setTriggerNum(triggerNum);
Response<SendRedEnvelopeResponse> sendResponse = envelopeController.sendRedEnvelope(sendRedEnvelopeRequest);
}
}
问题是:如何在客户端代码中将auth令牌标头添加到伪装中?
这是另一边的代码:
@PostMapping({"/send"})
Response<SendRedEnvelopeResponse> sendRedEnvelope(SendRedEnvelopeRequest var1);