系统参数过滤器

系统参数过滤器主要处理系统参数的传播,例如:用户登录后的信息

默认传输参数

  • 登录后用户id
  • requestId,请求唯一标识
  • 数据权限字符串

自定义参数

网管实现自定义参数后,可以通过自定义参数传送给后面的微服务。

需要继承com.wueasy.cloud.gateway.service.CustomParameterService接口

通过map定义定义需要传输的参数,key为header名称,value为header值

@Service
public class CustomParameterServiceImpl implements CustomParameterService {

    @Override
    public Map<String, String> getCustomParameterMap(ServerWebExchange exchange) {

        Map<String, String> map = new HashMap<>();
        map.put("usercode", "123456");
        return map;
    }

}
Copyright © wueasy.com 2017-2022 all right reserved,powered by Gitbook未经允许,禁止以任何形式传播 修订时间: 2022-02-26

results matching ""

    No results matching ""