Browse Source

更新水环境相关配置

pull/104/head
xiaoying 1 year ago
parent
commit
d98f0681c2
2 changed files with 18 additions and 0 deletions
  1. +10
    -0
      src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java
  2. +8
    -0
      src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java

+ 10
- 0
src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java View File

@@ -28,6 +28,11 @@ public class CommonsConfig {
*/
public static String waterwayPermissionUrl;

/**
* 水环境权限接口地址
*/
public static String weptspPermissionUrl;


@Value("${tuoheng.hhz-admin-perUrl}")
public void setHhzPermissionUrl(String url) {
@@ -44,4 +49,9 @@ public class CommonsConfig {
waterwayPermissionUrl = url;
}

@Value("${tuoheng.weptsp-admin-perUrl}")
public void setWeptspPermissionUrl(String url) {
weptspPermissionUrl = url;
}

}

+ 8
- 0
src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java View File

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

private static final String WATER_MP = "tuoheng-waterway-miniprogram";

private static final String WSPTSP_ADMIN = "tuoheng-wsptsp-admin";

/**
* 获取 gateway 路由前缀,匹配url
* @param clientId
@@ -60,6 +62,9 @@ public class GatewayUrlPathUtil {
case WATER_MP:
apiPath = "/waterway/miniprogram";
break;
case WSPTSP_ADMIN:
apiPath = "/wsptsp/admin";
break;
}
return apiPath;
}
@@ -81,6 +86,9 @@ public class GatewayUrlPathUtil {
if(clientId.equals(WATER_ADMIN) || clientId.equals(WATER_MP)){
url = CommonsConfig.waterwayPermissionUrl;
}
if(clientId.equals(WSPTSP_ADMIN)){
url = CommonsConfig.weptspPermissionUrl;
}
log.info("getRoleIdByApiUrlPermission -url:{},token:{}", url, token);
if(StringUtils.isNotBlank(url)){
HttpHeaders resultRequestHeader = new HttpHeaders();

Loading…
Cancel
Save