zoukankan      html  css  js  c++  java
  • pig项目feign调用登录/oauth/token接口;pig4cloud项目feign调用登录/oauth/token接口;feign调用OAuth2登录接口;feign调用oAuth2登录接口

     开始没加 headers = {"Content-Type: multipart/form-data", "Authorization=Basic cGlnOnBpZw=="} 一直请求报401

     feign调用401

    import com.pig4cloud.pig.common.core.constant.SecurityConstants;
    import com.pig4cloud.pig.common.core.constant.ServiceNameConstants;
    import org.springframework.cloud.openfeign.FeignClient;
    import org.springframework.stereotype.Service;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestHeader;
    import org.springframework.web.bind.annotation.RequestParam;
    
    import java.util.Map;
    
    @Service
    @FeignClient(value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory =PiaAuthServiceFallbackFactory.class)
    public interface PigAuthService {
    
        @PostMapping(value = "/oauth/token", headers = {"Content-Type: multipart/form-data", "Authorization=Basic cGlnOnBpZw=="})
        Object oauth( @RequestParam Map<String, String> parameters, @RequestHeader(SecurityConstants.FROM) String from);
    }
  • 相关阅读:
    MySQL中redo日志
    MySQL中事务的分类
    MySQL中事务的概述ACID了解
    MySQL中UNSIGNED和ZEROFILL的介绍
    MySQL中死锁
    谈谈当前火热的“车联网”
    线性代数回顾:矩阵运算
    Spark作业调度阶段分析
    Spark——共享变量
    Spark编译与打包
  • 原文地址:https://www.cnblogs.com/qq376324789/p/15102857.html
Copyright © 2011-2022 走看看