Преглед на файлове

Merge branch 'develop' into release

release
wanghaoran преди 5 месеца
родител
ревизия
d0609323fa
променени са 8 файла, в които са добавени 53 реда и са изтрити 4 реда
  1. +9
    -0
      src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java
  2. +1
    -0
      src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java
  3. +6
    -0
      src/main/java/com/tuoheng/gateway/constants/AuthorityConstant.java
  4. +2
    -1
      src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java
  5. +8
    -0
      src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java
  6. +9
    -1
      src/main/resources/application-dev.yml
  7. +9
    -1
      src/main/resources/application-prod.yml
  8. +9
    -1
      src/main/resources/application-test.yml

+ 9
- 0
src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java Целия файл

@@ -61,6 +61,10 @@ public class CommonsConfig {
* 设备管理服务接口地址
*/
public static String dmpPermissionUrl;
/**
* 低空综合服务接口地址
*/
public static String lacsPermissionUrl;


@Value("${tuoheng.hhz-admin-perUrl}")
@@ -115,4 +119,9 @@ public class CommonsConfig {
digitaltwinPermissionUrl = url;
}

@Value("${tuoheng.lacs-admin-perUrl}")
public void setLacsPermissionUrl(String url) {
lacsPermissionUrl = url;
}

}

+ 1
- 0
src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java Целия файл

@@ -98,6 +98,7 @@ public class WebSecurityConfig {
.pathMatchers("/spacetime/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_SPACETIME_ADMIN)
.pathMatchers("/digitaltwin/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_DIGITALTWIN_ADMIN)
.pathMatchers("/dmp/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_DMP_ADMIN)
//.pathMatchers("/lacs/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_LACS_ADMIN)
.pathMatchers("/airport/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_AIRPORT_ADMIN)
.pathMatchers("/oidc/admin/user/**").authenticated()
.pathMatchers("/api/inspection/**").authenticated()

+ 6
- 0
src/main/java/com/tuoheng/gateway/constants/AuthorityConstant.java Целия файл

@@ -94,4 +94,10 @@ public class AuthorityConstant {
*/
public static final String SCOPE_TUOHNEG_DMP_ADMIN = "SCOPE_tuoheng-dmp-admin";
//public static final String SCOPE_TUOHNEG_DMP_MP= "SCOPE_tuoheng-dmp-mp";

/**
* lacs 用户权限
*/
public static final String SCOPE_TUOHNEG_LACS_ADMIN = "SCOPE_tuoheng-lacs-admin";
//public static final String SCOPE_TUOHNEG_DMP_MP= "SCOPE_tuoheng-lacs-mp";
}

+ 2
- 1
src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java Целия файл

@@ -99,7 +99,8 @@ public class PermitPathConstant {
"/telecomumale/admin/cloudbox/callback/add/**",
"/telecomumale/admin/airport/inspection/executeTaskStatus/**",
"/telecomumale/admin/weiXin/send/message/**",
"/telecomumale/miniprogram/weiXin/**"
"/telecomumale/miniprogram/weiXin/**",
"/telecomumale/admin/oidcLogin/**"
};
public static String alertleUrlStr[] = {
"/alert/admin/third/event/**",

+ 8
- 0
src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java Целия файл

@@ -52,6 +52,8 @@ public class GatewayUrlPathUtil {

private static final String DMP_ADMIN = "tuoheng-dmp-admin";

private static final String LACS_ADMIN = "tuoheng-lacs-admin";


/**
* 获取 gateway 路由前缀,匹配url
@@ -104,6 +106,9 @@ public class GatewayUrlPathUtil {
case DMP_ADMIN:
apiPath = "/dmp/admin";
break;
case LACS_ADMIN:
apiPath = "/lacs/admin";
break;
default:
break;
}
@@ -152,6 +157,9 @@ public class GatewayUrlPathUtil {
if (clientId.equals(DMP_ADMIN)) {
url = CommonsConfig.dmpPermissionUrl;
}
if (clientId.equals(LACS_ADMIN)) {
url = CommonsConfig.lacsPermissionUrl;
}
log.info("getRoleIdByApiUrlPermission -url:{},token:{}", url, token);
if (StringUtils.isNotBlank(url)) {
HttpHeaders resultRequestHeader = new HttpHeaders();

+ 9
- 1
src/main/resources/application-dev.yml Целия файл

@@ -283,6 +283,13 @@ spring:
- Path=/dmp/admin/**
filters:
- StripPrefix=2
# 低空综合 admin服务
- id: tuoheng-lacs-admin
uri: lb://tuoheng-lacs-admin
predicates:
- Path=/lacs/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -321,4 +328,5 @@ tuoheng:
telecomumale-admin-perUrl: http://192.168.11.11:9150/permission/getRoleIdList
spacetime-admin-perUrl: http://192.168.11.11:9170/permission/getRoleIdList
digitaltwin-admin-perUrl: http://192.168.11.11:9180/permission/getRoleIdList
dmp-admin-perUrl: http://192.168.11.11:9190/permission/getRoleIdList
dmp-admin-perUrl: http://192.168.11.11:9190/permission/getRoleIdList
lacs-admin-perUrl: http://192.168.11.11:9220/permission/getRoleIdList

+ 9
- 1
src/main/resources/application-prod.yml Целия файл

@@ -275,6 +275,13 @@ spring:
- Path=/dmp/admin/**
filters:
- StripPrefix=2
# 低空综合 admin服务
- id: tuoheng-lacs-admin
uri: lb://tuoheng-lacs-admin
predicates:
- Path=/lacs/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -313,4 +320,5 @@ tuoheng:
alert-admin-perUrl: https://alert.t-aaron.com/permission/getRoleIdList
spacetime-admin-perUrl: https://spacetime.t-aaron.com/permission/getRoleIdList
digitaltwin-admin-perUrl: https://digitaltwin.t-aaron.com/permission/getRoleIdList
dmp-admin-perUrl: https://dmp.t-aaron.com/permission/getRoleIdList
dmp-admin-perUrl: https://dmp.t-aaron.com/permission/getRoleIdList
lacs-admin-perUrl: https://lacs.t-aaron.com/permission/getRoleIdList

+ 9
- 1
src/main/resources/application-test.yml Целия файл

@@ -283,6 +283,13 @@ spring:
- Path=/dmp/admin/**
filters:
- StripPrefix=2
# 低空综合 admin服务
- id: tuoheng-lacs-admin
uri: lb://tuoheng-lacs-admin
predicates:
- Path=/lacs/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -321,4 +328,5 @@ tuoheng:
telecomumale-admin-perUrl: https://telecomumale-test.t-aaron.com/permission/getRoleIdList
spacetime-admin-perUrl: https://spacetime-test.t-aaron.com/permission/getRoleIdList
digitaltwin-admin-perUrl: https://digitaltwin-test.t-aaron.com/permission/getRoleIdList
dmp-admin-perUrl: https://dmp-test.t-aaron.com/permission/getRoleIdList
dmp-admin-perUrl: https://dmp-test.t-aaron.com/permission/getRoleIdList
lacs-admin-perUrl: https://lacs-test.t-aaron.com/permission/getRoleIdList

Loading…
Отказ
Запис