Browse Source

高速平台对接调整

pull/62/head
chenjiandong 1 year ago
parent
commit
a1659d0ddf
2 changed files with 10 additions and 2 deletions
  1. +3
    -2
      src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java
  2. +7
    -0
      src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java

+ 3
- 2
src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java View File

@@ -64,11 +64,12 @@ public class WebSecurityConfig {
@Bean
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity httpSecurity){
String[] OAUTH_PATH = oauthUrlStr.split(",");
String[] HhzPermitPath = PermitPathConstant.hhzPermitUrlStr;
String[] hhzPermitPath = PermitPathConstant.hhzPermitUrlStr;
String[] freewayPermitPath = PermitPathConstant.freewayPermitUrlStr;
httpSecurity
.authorizeExchange()
.pathMatchers(OAUTH_PATH).hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_DSP_MP, AuthorityConstant.SCOPE_TUOHNEG_DSP_WEB)
.pathMatchers(HhzPermitPath).permitAll()
.pathMatchers(hhzPermitPath).permitAll().pathMatchers(freewayPermitPath).permitAll()
.pathMatchers("/pilot/miniprogram/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_PILOT_MP)
.pathMatchers("/pilot/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_PILOT_ADMIN)
.pathMatchers("/hhz/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_HHZ_ADMIN)

+ 7
- 0
src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java View File

@@ -31,4 +31,11 @@ public class PermitPathConstant {
"/hhz/api/tencentCloudRtc/genUserSig/**"
};

public static String freewayPermitUrlStr[] = {
"/freeway/admin/inspection/uploadFlightUrl/**",
"/freeway/admin/inspection/uploadFlightUrl/**",
"/airport/inspection/status/**",
"/airport/inspection/track/**"
};

}

Loading…
Cancel
Save