瀏覽代碼

代码重构

tom.xu@informa.com 2 年之前
父節點
當前提交
20d60535df
共有 25 個文件被更改,包括 23 次插入10 次删除
  1. 5 3
      src/main/java/ieven/server/webapp/api/UserController.java
  2. 1 3
      src/main/java/ieven/server/webapp/config/LoginInterceptor.java
  3. 1 2
      src/main/java/ieven/server/webapp/config/WebMvcConfig.java
  4. 0 1
      src/main/resources/application.properties
  5. 0 0
      src/main/resources/static/bgimg.png
  6. 0 0
      src/main/resources/static/css/app.3986304a6058797e22d1ddfc282a956b.css
  7. 0 0
      src/main/resources/static/fonts/element-icons.535877f.woff
  8. 0 0
      src/main/resources/static/fonts/element-icons.732389d.ttf
  9. 0 0
      src/main/resources/static/image/people.png
  10. 0 0
      src/main/resources/static/img/34567.9e2a049.png
  11. 0 0
      src/main/resources/static/img/bg.b911eb2.png
  12. 0 0
      src/main/resources/static/img/copy.0744abf.png
  13. 16 1
      src/main/resources/static/index.html
  14. 0 0
      src/main/resources/static/js/1.29ba346985ee6958348b.js
  15. 0 0
      src/main/resources/static/js/2.81bdebc4f35de0a8e496.js
  16. 0 0
      src/main/resources/static/js/3.2f8a46d076fbc01d600b.js
  17. 0 0
      src/main/resources/static/js/4.39c9dbc30edffe32bf3a.js
  18. 0 0
      src/main/resources/static/js/5.fcdf29e69e4f873cdb10.js
  19. 0 0
      src/main/resources/static/js/6.45ae0f0f221919860a05.js
  20. 0 0
      src/main/resources/static/js/7.14c6d691c1c10a72d1dd.js
  21. 0 0
      src/main/resources/static/js/8.5e9c34acc2267e2a08c4.js
  22. 0 0
      src/main/resources/static/js/app.bdd53a40214e9213a3c5.js
  23. 0 0
      src/main/resources/static/js/manifest.edaf0c9515a8baba43c8.js
  24. 0 0
      src/main/resources/static/js/vendor-async.faf63e3ae26f0c7c5766.js
  25. 0 0
      src/main/resources/static/js/vendor.5ade341cd54c26914783.js

+ 5 - 3
src/main/java/ieven/server/webapp/api/UserController.java

@@ -4,13 +4,14 @@ import ieven.server.webapp.domain.user.User;
 import ieven.server.webapp.infrastructure.wrapper.Mapped;
 import ieven.server.webapp.infrastructure.wrapper.Mapped;
 import ieven.server.webapp.service.user.UserService;
 import ieven.server.webapp.service.user.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSession;
 
 
-@RequestMapping("")
+@Controller
 public class UserController {
 public class UserController {
   @Autowired UserService userService;
   @Autowired UserService userService;
   /**
   /**
@@ -30,9 +31,10 @@ public class UserController {
     return Mapped.ERROR("用户名或者密码错误!");
     return Mapped.ERROR("用户名或者密码错误!");
   }
   }
 
 
-  @RequestMapping("/")
+  @RequestMapping("/index")
   public String index() {
   public String index() {
-    return "index";
+    System.out.println("1111");
+    return "index.html";
   }
   }
 
 
   @RequestMapping("login/out")
   @RequestMapping("login/out")

+ 1 - 3
src/main/java/ieven/server/webapp/config/LoginInterceptor.java

@@ -16,13 +16,11 @@ import java.nio.charset.StandardCharsets;
 @Component
 @Component
 @Slf4j
 @Slf4j
 public class LoginInterceptor implements HandlerInterceptor {
 public class LoginInterceptor implements HandlerInterceptor {
+
   @Override
   @Override
   public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
   public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
       throws Exception {
       throws Exception {
-    log.info(request.getSession().getId());
-    log.info(request.getRequestURI());
     User user = (User) request.getSession().getAttribute("loginUser");
     User user = (User) request.getSession().getAttribute("loginUser");
-    log.info(JSONUtil.toJsonStr(user));
     if (user == null) {
     if (user == null) {
       returnNoLogin(response);
       returnNoLogin(response);
       return false;
       return false;

+ 1 - 2
src/main/java/ieven/server/webapp/config/WebMvcConfig.java

@@ -10,7 +10,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 public class WebMvcConfig implements WebMvcConfigurer {
 public class WebMvcConfig implements WebMvcConfigurer {
   @Autowired LoginInterceptor loginInterceptor;
   @Autowired LoginInterceptor loginInterceptor;
 
 
-  // 设置静态资源映射
   @Override
   @Override
   public void addResourceHandlers(ResourceHandlerRegistry registry) {
   public void addResourceHandlers(ResourceHandlerRegistry registry) {
     registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
     registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
@@ -21,6 +20,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
     registry
     registry
         .addInterceptor(loginInterceptor)
         .addInterceptor(loginInterceptor)
         .addPathPatterns("/**")
         .addPathPatterns("/**")
-        .excludePathPatterns("index.html", "/", "/user/login");
+        .excludePathPatterns("/index.html", "/index", "/user/login", "/static/**");
   }
   }
 }
 }

+ 0 - 1
src/main/resources/application.properties

@@ -12,7 +12,6 @@ spring.servlet.multipart.max-request-size=1024MB
 logging.level.org.springframework.data.mongodb.core=DEBUG
 logging.level.org.springframework.data.mongodb.core=DEBUG
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.time-zone=GMT+8
 spring.jackson.time-zone=GMT+8
-spring.web.resources.static-locations=classpath:/static/
 spring.data.fileUploadPath=D:\\tempFiles\\createModel
 spring.data.fileUploadPath=D:\\tempFiles\\createModel
 headers.anti-cheat-origin=\u5E8F\u53F7,\u652F\u4ED8\u8BA2\u5355\u53F7,\u4EA4\u6613\u7C7B\u578B,\u652F\u4ED8\u7C7B\u578B,\u4EA4\u6613\u4E3B\u4F53\u7684\u51FA\u5165\u8D26\u6807\u8BC6,\u4EA4\u6613\u65F6\u95F4,\u5E01\u79CD,\u4EA4\u6613\u91D1\u989D,\u4EA4\u6613\u6D41\u6C34\u53F7,\u4EA4\u6613\u4F59\u989D,\
 headers.anti-cheat-origin=\u5E8F\u53F7,\u652F\u4ED8\u8BA2\u5355\u53F7,\u4EA4\u6613\u7C7B\u578B,\u652F\u4ED8\u7C7B\u578B,\u4EA4\u6613\u4E3B\u4F53\u7684\u51FA\u5165\u8D26\u6807\u8BC6,\u4EA4\u6613\u65F6\u95F4,\u5E01\u79CD,\u4EA4\u6613\u91D1\u989D,\u4EA4\u6613\u6D41\u6C34\u53F7,\u4EA4\u6613\u4F59\u989D,\
   \u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u673A\u6784\u7F16\u7801,\u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u540D\u79F0,\u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u5361\u53F7,\u6536\u6B3E\u65B9\u7684\u652F\u4ED8\u5E10\u53F7,\u6D88\u8D39pos\u673A\u7F16\u53F7,\u6536\u6B3E\u65B9\u7684\u5546\u6237\u53F7,\
   \u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u673A\u6784\u7F16\u7801,\u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u540D\u79F0,\u6536\u6B3E\u65B9\u94F6\u884C\u5361\u6240\u5C5E\u94F6\u884C\u5361\u53F7,\u6536\u6B3E\u65B9\u7684\u652F\u4ED8\u5E10\u53F7,\u6D88\u8D39pos\u673A\u7F16\u53F7,\u6536\u6B3E\u65B9\u7684\u5546\u6237\u53F7,\

+ 0 - 0
src/main/resources/static/static/bgimg.png → src/main/resources/static/bgimg.png


+ 0 - 0
src/main/resources/static/static/css/app.3986304a6058797e22d1ddfc282a956b.css → src/main/resources/static/css/app.3986304a6058797e22d1ddfc282a956b.css


+ 0 - 0
src/main/resources/static/static/fonts/element-icons.535877f.woff → src/main/resources/static/fonts/element-icons.535877f.woff


+ 0 - 0
src/main/resources/static/static/fonts/element-icons.732389d.ttf → src/main/resources/static/fonts/element-icons.732389d.ttf


+ 0 - 0
src/main/resources/static/static/image/people.png → src/main/resources/static/image/people.png


+ 0 - 0
src/main/resources/static/static/img/34567.9e2a049.png → src/main/resources/static/img/34567.9e2a049.png


+ 0 - 0
src/main/resources/static/static/img/bg.b911eb2.png → src/main/resources/static/img/bg.b911eb2.png


+ 0 - 0
src/main/resources/static/static/img/copy.0744abf.png → src/main/resources/static/img/copy.0744abf.png


+ 16 - 1
src/main/resources/static/index.html

@@ -1 +1,16 @@
-<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><meta http-equiv=X-UA-Compatible content="IE=edge"><title>追迹者-资金清洗研判系统</title><link href=/static/css/app.3986304a6058797e22d1ddfc282a956b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.edaf0c9515a8baba43c8.js></script><script type=text/javascript src=/static/js/vendor.5ade341cd54c26914783.js></script><script type=text/javascript src=/static/js/app.bdd53a40214e9213a3c5.js></script></body></html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>追迹者-资金清洗研判系统222</title>
+    <link href="static/css/app.3986304a6058797e22d1ddfc282a956b.css" rel="stylesheet">
+</head>
+<body>
+<div id="app"></div>
+<script type="text/javascript" src="static/js/manifest.edaf0c9515a8baba43c8.js"></script>
+<script type="text/javascript" src="static/js/vendor.5ade341cd54c26914783.js"></script>
+<script type="text/javascript" src="static/js/app.bdd53a40214e9213a3c5.js"></script>
+</body>
+</html>

+ 0 - 0
src/main/resources/static/static/js/1.29ba346985ee6958348b.js → src/main/resources/static/js/1.29ba346985ee6958348b.js


+ 0 - 0
src/main/resources/static/static/js/2.81bdebc4f35de0a8e496.js → src/main/resources/static/js/2.81bdebc4f35de0a8e496.js


+ 0 - 0
src/main/resources/static/static/js/3.2f8a46d076fbc01d600b.js → src/main/resources/static/js/3.2f8a46d076fbc01d600b.js


+ 0 - 0
src/main/resources/static/static/js/4.39c9dbc30edffe32bf3a.js → src/main/resources/static/js/4.39c9dbc30edffe32bf3a.js


+ 0 - 0
src/main/resources/static/static/js/5.fcdf29e69e4f873cdb10.js → src/main/resources/static/js/5.fcdf29e69e4f873cdb10.js


+ 0 - 0
src/main/resources/static/static/js/6.45ae0f0f221919860a05.js → src/main/resources/static/js/6.45ae0f0f221919860a05.js


+ 0 - 0
src/main/resources/static/static/js/7.14c6d691c1c10a72d1dd.js → src/main/resources/static/js/7.14c6d691c1c10a72d1dd.js


+ 0 - 0
src/main/resources/static/static/js/8.5e9c34acc2267e2a08c4.js → src/main/resources/static/js/8.5e9c34acc2267e2a08c4.js


+ 0 - 0
src/main/resources/static/static/js/app.bdd53a40214e9213a3c5.js → src/main/resources/static/js/app.bdd53a40214e9213a3c5.js


+ 0 - 0
src/main/resources/static/static/js/manifest.edaf0c9515a8baba43c8.js → src/main/resources/static/js/manifest.edaf0c9515a8baba43c8.js


+ 0 - 0
src/main/resources/static/static/js/vendor-async.faf63e3ae26f0c7c5766.js → src/main/resources/static/js/vendor-async.faf63e3ae26f0c7c5766.js


+ 0 - 0
src/main/resources/static/static/js/vendor.5ade341cd54c26914783.js → src/main/resources/static/js/vendor.5ade341cd54c26914783.js