feign.FeignException: status 401 reading XXXXX

权限下无法调用feign 报错信息为 

401 , {"error":"unauthorized","error_description":"Full authentication is required to access this resource"}

解决办法可以在feign类上加个注解

e.g.

@FeignClient(name = "user",configuration = FeignConfig.class)
public interface UserFeignClient {
  @GetMapping("/user/branch/branchStudent/find")
  public BranchStudent findByBranchStudentId(@RequestParam("studentId") Long studentId);
※调用微服务时记得接口路径前加上项目名称
友情链接:  https://www.jianshu.com/p/44e877e395a9?from=timeline


猜你喜欢

转载自blog.csdn.net/weixin_41917449/article/details/80930908