Browse Source

1、测试环境拦截器截取路径与本地环境有差异,多了一层/api

master
bjang03 6 months ago
parent
commit
c4f3835701
  1. 7
      win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java

7
win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java

@ -24,7 +24,7 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor {
int count = 0;
int index = -1;
while(count < 5) {
while(count < 2) {
index = str.indexOf(c, index + 1);
count++;
}
@ -33,7 +33,10 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor {
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String moduleName = request.getRequestURI().substring(0,findThirdOccurrence(request.getRequestURI(),'/'));
String uri = request.getRequestURI().substring(request.getRequestURI().indexOf("admin-api")+"admin-api".length());
String moduleName = uri.substring(0,findThirdOccurrence(request.getRequestURI(),'/'));
log.info(String.format("===uri-src=%s,uri-md5=%s===",moduleName,md5.digestHex(moduleName)));
log.info(String.format("===cache=%s===", new JSONObject(ModuleAuthenUtils.module).toString()));
String endTimeStr = ModuleAuthenUtils.module.get(md5.digestHex(moduleName));
if(endTimeStr != null){
LocalDateTime endTime = LocalDateTime.parse(ModuleAuthenUtils.decrypt(endTimeStr,ModuleAuthenUtils.secretKey), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));

Loading…
Cancel
Save