潘志宝
5 天以前 7fce3006ecd0b670e33c2d3ba123778e79e2e943
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.iailab.framework.security.config;
 
import com.iailab.framework.security.core.rpc.LoginUserRequestInterceptor;
import com.iailab.module.system.api.oauth2.OAuth2TokenApi;
import com.iailab.module.system.api.permission.PermissionApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
 
/**
 * Security 使用到 Feign 的配置项
 *
 * @author iailab
 */
@AutoConfiguration
@EnableFeignClients(clients = {OAuth2TokenApi.class, // 主要是引入相关的 API 服务
        PermissionApi.class})
public class IailabSecurityRpcAutoConfiguration {
 
    @Bean
    public LoginUserRequestInterceptor loginUserRequestInterceptor() {
        return new LoginUserRequestInterceptor();
    }
 
}