whycxzp
2023-08-25 93fe965c0d218f8522d4bc47d1bd0acd61992651
解决首页404问题
2个文件已修改
8 ■■■■■ 已修改文件
src/main/java/com/whyc/EnvirMonitorSysApplication.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/filter/CrossDomainFilter.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/EnvirMonitorSysApplication.java
@@ -3,9 +3,11 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@SpringBootApplication
@ServletComponentScan(basePackages = {"com.whyc.filter"})
@EnableWebMvc
@ServletComponentScan
public class EnvirMonitorSysApplication {
    public static void main(String[] args) {
src/main/java/com/whyc/filter/CrossDomainFilter.java
@@ -49,12 +49,12 @@
                resp.setStatus(202);
                return;
            }
            HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper((HttpServletRequest)req);
            /*HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper((HttpServletRequest)req);
            if(servletPath.equals("/index.html") && req.getParameter("n") == null) {
                RequestDispatcher dispatcher = wrapper.getRequestDispatcher("/");
                dispatcher.forward(request, resp);
                return;
            }
            }*/
        }
        chain.doFilter(request, resp);