liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
xp-robotaxi-gateway-boot/src/main/java/com/xiaopeng/gateway/filter/AuthFilter.java
@@ -89,6 +89,9 @@
      String username = JwtUtils.getUserName(claims);
      String userType = JwtUtils.getUserType(claims);
      String operationUserKey = JwtUtils.getOperationUserKey(claims);
      if (!checkPathPermission(userType, url)) {
         return unauthorizedResponse(exchange, "无权访问当前资源");
      }
      String redisKey = "";
      if ("system".equals(userType)) {
         redisKey = StringUtils.isNotBlank(userkey) ? getTokenKey(userkey) : "";
@@ -153,6 +156,17 @@
   private String getTokenKey(String token) {
      return CacheConstants.LOGIN_TOKEN_KEY + token;
   }
   private boolean checkPathPermission(String userType, String url) {
      boolean appPath = StringUtils.isNotBlank(url) && url.contains("/maintenance-app");
      if ("operation".equals(userType)) {
         return appPath;
      }
      if ("system".equals(userType)) {
         return !appPath;
      }
      return true;
   }
   
   /**
    * 获取请求token
@@ -194,4 +208,4 @@
   public int getOrder() {
      return -300;
   }
}
}