微服务Feign调用后开启Schedule定时任务后报错
No thread-bound request found: Are you referring to request attributes outsid
此方法用于:单独调用接口没问题,开启定时任务就报错
解决方法
FeignClient类方法加参数@RequestHeader(“from”) String from
@RequestMapping(value = "/user/list", method = RequestMethod.GET)
R<List<SysUser>> getUserList(@RequestHeader("from") String from);
```
调用方式,穿参“Y”
```
sysAdminService.getUserList("Y");
```