探寻俄罗斯的东方之眼:冰雪之下涌动的勃勃生机

核心内容摘要

流量之巅的众生相:王多鱼、博雅、韩婧格背后的数字娱乐密码
迷你世界花小楼被狂按c

峡谷里的无声告白:当王者荣耀女英雄褪去情感的枷锁

套路脚手架看一眼就行了没啥技术含量package com.tianji.gateway.filter; import com.tianji.authsdk.gateway.util.AuthUtil; import com.tianji.common.domain.R; import com.tianji.common.domain.dto.LoginUserDTO; import com.tianji.gateway.config.AuthProperties; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.core.Ordered; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.stereotype.Component; import org.springframework.util.AntPathMatcher; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; import java.util.List; import static com.tianji.auth.common.constants.JwtConstants.AUTHORIZATION_HEADER; import static com.tianji.auth.common.constants.JwtConstants.USER_HEADER; Component public class AccountAuthFilter implements GlobalFilter, Ordered { private final AuthUtil authUtil; private final AuthProperties authProperties; private final AntPathMatcher antPathMatcher new AntPathMatcher(); public AccountAuthFilter(AuthUtil authUtil, AuthProperties authProperties) { this.authUtil authUtil; this.authProperties authProperties; } Override public MonoVoid filter(ServerWebExchange exchange, GatewayFilterChain chain) { //

获取请求request信息 ServerHttpRequest request exchange.getRequest(); String method request.getMethodValue(); String path request.getPath().toString(); String antPath method : path; //

判断是否是无需登录的路径 if(isExcludePath(antPath)){ // 直接放行 return chain.filter(exchange); } //

尝试获取用户信息 ListString authHeaders exchange.getRequest().getHeaders().get(AUTHORIZATION_HEADER); String token authHeaders null ? : authHeaders.get(

; RLoginUserDTO r authUtil.parseToken(token); //

如果用户是登录状态尝试更新请求头传递用户信息 if(r.success()){ exchange.mutate() .request(builder - builder.header(USER_HEADER, r.getData().getUserId().toString())) .build(); } //

校验权限 authUtil.checkAuth(antPath, r); //

放行 return chain.filter(exchange); } private boolean isExcludePath(String antPath) { for (String pathPattern : authProperties.getExcludePath()) { if(antPathMatcher.match(pathPattern, antPath)){ return true; } } return false; } Override public int getOrder() { return 1000; } }

小扫货几天没干了怎么多了-小扫货几天没干了怎么多了应用

百度百家号客服电话人工服务

123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123