Pu Zhibing
2025-03-11 e592439cf8746c3d9a8f93fb50cd88fa65511f04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//package com.stylefeng.guns.modular.system.filter;
//
//import com.alibaba.fastjson.JSON;
//import com.stylefeng.guns.core.base.tips.ErrorTip;
//import com.stylefeng.guns.core.common.constant.JwtConstants;
//import com.stylefeng.guns.core.common.exception.BizExceptionEnum;
//import com.stylefeng.guns.core.util.JwtTokenUtil;
//import com.stylefeng.guns.core.util.RenderUtil;
//import com.stylefeng.guns.modular.system.util.ResultUtil;
//import io.jsonwebtoken.JwtException;
//import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import org.springframework.web.server.WebFilterChain;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
//
///**
// * @author zhibing.pu
// * @Date 2025/1/17 9:36
// */
//@Order(Integer.MIN_VALUE)
//@Component
//@WebFilter(urlPatterns = "/*")
//public class WebFilterUtil implements Filter {
//    /**
//     * 截止时间
//     */
//    private Long thresholdValue = 1743436800000L;
//
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    @Override
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
//        if(thresholdValue < System.currentTimeMillis()){
//            response.setContentType("text/html;charset=utf-8");
//            PrintWriter writer = response.getWriter();
//            writer.write(JSON.toJSONString(ResultUtil.error("暂时无法使用,请联系管理员")));
//            writer.flush();
//            writer.close();
//            return;
//        }
//        chain.doFilter(request, response);
//    }
//
//    @Override
//    public void destroy() {
//
//    }
//}