@@ -57,13 +57,20 @@ public class CommonsConfig { | |||
* 数字孪生服务接口地址 | |||
*/ | |||
public static String digitaltwinPermissionUrl; | |||
/** | |||
* 设备管理服务接口地址 | |||
*/ | |||
public static String dmpPermissionUrl; | |||
@Value("${tuoheng.hhz-admin-perUrl}") | |||
public void setHhzPermissionUrl(String url) { | |||
hhzPermissionUrl = url; | |||
} | |||
@Value("${tuoheng.dmp-admin-perUrl}") | |||
public void setDmpPermissionUrl(String url) { | |||
dmpPermissionUrl = url; | |||
} | |||
@Value("${tuoheng.spacetime-admin-perUrl}") | |||
public void setSpacetimePermissionUrl(String url) { | |||
spacetimePermissionUrl = url; |
@@ -97,6 +97,7 @@ public class WebSecurityConfig { | |||
.pathMatchers("/alert/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_ALERT_ADMIN) | |||
.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("/airport/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_AIRPORT_ADMIN) | |||
.pathMatchers("/oidc/admin/user/**").authenticated() | |||
.pathMatchers("/api/inspection/**").authenticated() |
@@ -88,4 +88,10 @@ public class AuthorityConstant { | |||
*/ | |||
public static final String SCOPE_TUOHNEG_DIGITALTWIN_ADMIN = "SCOPE_tuoheng-digitaltwin-admin"; | |||
//public static final String SCOPE_TUOHNEG_ALERT_MP= "SCOPE_tuoheng-alert-mp"; | |||
/** | |||
* Digitaltwin 用户权限 | |||
*/ | |||
public static final String SCOPE_TUOHNEG_DMP_ADMIN = "SCOPE_tuoheng-dmp-admin"; | |||
//public static final String SCOPE_TUOHNEG_DMP_MP= "SCOPE_tuoheng-dmp-mp"; | |||
} |
@@ -50,6 +50,8 @@ public class GatewayUrlPathUtil { | |||
private static final String DIGITALTWIN_ADMIN = "tuoheng-digitaltwin-admin"; | |||
private static final String DMP_ADMIN = "tuoheng-dmp-admin"; | |||
/** | |||
* 获取 gateway 路由前缀,匹配url | |||
@@ -99,6 +101,9 @@ public class GatewayUrlPathUtil { | |||
case DIGITALTWIN_ADMIN: | |||
apiPath = "/digitaltwin/admin"; | |||
break; | |||
case DMP_ADMIN: | |||
apiPath = "/dmp/admin"; | |||
break; | |||
default: | |||
break; | |||
} | |||
@@ -144,6 +149,9 @@ public class GatewayUrlPathUtil { | |||
if (clientId.equals(DIGITALTWIN_ADMIN)) { | |||
url = CommonsConfig.digitaltwinPermissionUrl; | |||
} | |||
if (clientId.equals(DMP_ADMIN)) { | |||
url = CommonsConfig.dmpPermissionUrl; | |||
} | |||
log.info("getRoleIdByApiUrlPermission -url:{},token:{}", url, token); | |||
if (StringUtils.isNotBlank(url)) { | |||
HttpHeaders resultRequestHeader = new HttpHeaders(); |
@@ -276,6 +276,13 @@ spring: | |||
- Path=/digitaltwin/admin/** | |||
filters: | |||
- StripPrefix=2 | |||
# 设备管理 admin服务 | |||
- id: tuoheng-digitaltwin-admin | |||
uri: lb://tuoheng-digitaltwin-admin | |||
predicates: | |||
- Path=/digitaltwin/admin/** | |||
filters: | |||
- StripPrefix=2 | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
@@ -313,4 +320,5 @@ tuoheng: | |||
airmonitor-admin-perUrl: http://192.168.11.11:9130/permission/getRoleIdList | |||
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 | |||
digitaltwin-admin-perUrl: http://192.168.11.11:9180/permission/getRoleIdList | |||
dmp-admin-perUrl: http://192.168.11.11:9190/permission/getRoleIdList |
@@ -276,6 +276,13 @@ spring: | |||
- Path=/digitaltwin/admin/** | |||
filters: | |||
- StripPrefix=2 | |||
# 设备管理 admin服务 | |||
- id: tuoheng-digitaltwin-admin | |||
uri: lb://tuoheng-digitaltwin-admin | |||
predicates: | |||
- Path=/digitaltwin/admin/** | |||
filters: | |||
- StripPrefix=2 | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
@@ -313,4 +320,5 @@ tuoheng: | |||
airmonitor-admin-perUrl: https://airmonitor-test.t-aaron.com/permission/getRoleIdList | |||
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 | |||
digitaltwin-admin-perUrl: https://digitaltwin-test.t-aaron.com/permission/getRoleIdList | |||
dmp-admin-perUrl: https://dmp-test.t-aaron.com/permission/getRoleIdList |