Browse Source

代码重构

tom.xu@informa.com 2 years ago
parent
commit
677b0a111a
28 changed files with 26 additions and 29 deletions
  1. 4 2
      src/main/java/ieven/server/webapp/api/UserController.java
  2. 15 1
      src/main/java/ieven/server/webapp/config/LoginInterceptor.java
  3. 3 8
      src/main/java/ieven/server/webapp/config/WebConfiger.java
  4. 2 1
      src/main/resources/application.properties
  5. 1 16
      src/main/resources/static/index.html
  6. 0 0
      src/main/resources/static/js/5.fcdf29e69e4f873cdb10.js
  7. 0 0
      src/main/resources/static/static/bgimg.png
  8. 0 0
      src/main/resources/static/static/css/app.3986304a6058797e22d1ddfc282a956b.css
  9. 0 0
      src/main/resources/static/static/fonts/element-icons.535877f.woff
  10. 0 0
      src/main/resources/static/static/fonts/element-icons.732389d.ttf
  11. 0 0
      src/main/resources/static/static/image/people.png
  12. 0 0
      src/main/resources/static/static/img/34567.9e2a049.png
  13. 0 0
      src/main/resources/static/static/img/WechatIMG5377.0744abf.png
  14. 0 0
      src/main/resources/static/static/img/bg.b911eb2.png
  15. BIN
      src/main/resources/static/static/img/copy.0744abf.png
  16. 0 0
      src/main/resources/static/static/js/1.29ba346985ee6958348b.js
  17. 0 0
      src/main/resources/static/static/js/2.81bdebc4f35de0a8e496.js
  18. 0 0
      src/main/resources/static/static/js/3.2f8a46d076fbc01d600b.js
  19. 0 0
      src/main/resources/static/static/js/4.39c9dbc30edffe32bf3a.js
  20. 0 0
      src/main/resources/static/static/js/5.06b87ddbabe13f782089.js
  21. 0 0
      src/main/resources/static/static/js/6.45ae0f0f221919860a05.js
  22. 0 0
      src/main/resources/static/static/js/7.14c6d691c1c10a72d1dd.js
  23. 0 0
      src/main/resources/static/static/js/8.5e9c34acc2267e2a08c4.js
  24. 0 0
      src/main/resources/static/static/js/app.bdd53a40214e9213a3c5.js
  25. 1 1
      src/main/resources/static/static/js/manifest.21e1ef6238ab89b35278.js
  26. 0 0
      src/main/resources/static/static/js/vendor-async.faf63e3ae26f0c7c5766.js
  27. 0 0
      src/main/resources/static/static/js/vendor.5ade341cd54c26914783.js
  28. BIN
      src/main/resources/static/static/media/5373_1668503119.729c22f.mp4

+ 4 - 2
src/main/java/ieven/server/webapp/api/UserController.java

@@ -3,6 +3,7 @@ package ieven.server.webapp.api;
 import ieven.server.webapp.domain.user.User;
 import ieven.server.webapp.infrastructure.wrapper.Mapped;
 import ieven.server.webapp.service.user.UserService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpSession;
 
+@Slf4j
 @Controller
 public class UserController {
   @Autowired UserService userService;
@@ -31,9 +33,9 @@ public class UserController {
     return Mapped.ERROR("用户名或者密码错误!");
   }
 
-  @RequestMapping("/index")
+  @RequestMapping({"alipay", "/"})
   public String index() {
-    System.out.println("1111");
+    log.info("index");
     return "index.html";
   }
 

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

@@ -17,13 +17,27 @@ import java.nio.charset.StandardCharsets;
 @Slf4j
 public class LoginInterceptor implements HandlerInterceptor {
 
+  String[] excludePaths = {"/index.html", "/file", "/group", "/model", "/login", "/user/login"};
+
   @Override
   public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
       throws Exception {
+    log.info(request.getRequestURI());
+    boolean f = false;
+    String requestURI = request.getRequestURI();
+    for (String excludePath : excludePaths) {
+      if (requestURI.equals(excludePath)) {
+        f = true;
+        break;
+      }
+    }
+    if (f) {
+      return true;
+    }
     User user = (User) request.getSession().getAttribute("loginUser");
     if (user == null) {
       returnNoLogin(response);
-      return false;
+      return true;
     } else {
       return true;
     }

+ 3 - 8
src/main/java/ieven/server/webapp/config/WebMvcConfig.java → src/main/java/ieven/server/webapp/config/WebConfiger.java

@@ -3,23 +3,18 @@ package ieven.server.webapp.config;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 @Configuration
-public class WebMvcConfig implements WebMvcConfigurer {
+public class WebConfiger implements WebMvcConfigurer {
+  // 自定义国际化组件
   @Autowired LoginInterceptor loginInterceptor;
 
-  @Override
-  public void addResourceHandlers(ResourceHandlerRegistry registry) {
-    registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
-  }
-
   @Override
   public void addInterceptors(InterceptorRegistry registry) {
     registry
         .addInterceptor(loginInterceptor)
         .addPathPatterns("/**")
-        .excludePathPatterns("/index.html", "/index", "/user/login", "/static/**");
+        .excludePathPatterns("index.html", "/", "/api/login", "/static/**");
   }
 }

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

@@ -1,6 +1,7 @@
+server.servlet.context-path=/
 spring.application.name=webapp
 #spring.data.mongodb.uri=mongodb://admin:123456@localhost:27017/ieven
-spring.data.mongodb.uri=mongodb://localhost:28000/user_model
+spring.data.mongodb.uri=mongodb://localhost:27017/user_model
 #spring.data.mongodb.database=idata
 #spring.data.mongodb.host=localhost
 #spring.data.mongodb.port=27017

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

@@ -1,16 +1 @@
-<!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>
+<!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.21e1ef6238ab89b35278.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>

File diff suppressed because it is too large
+ 0 - 0
src/main/resources/static/js/5.fcdf29e69e4f873cdb10.js


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


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


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


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


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


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


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


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


BIN
src/main/resources/static/static/img/copy.0744abf.png


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


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


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


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


File diff suppressed because it is too large
+ 0 - 0
src/main/resources/static/static/js/5.06b87ddbabe13f782089.js


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


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


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


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


+ 1 - 1
src/main/resources/static/js/manifest.edaf0c9515a8baba43c8.js → src/main/resources/static/static/js/manifest.21e1ef6238ab89b35278.js

@@ -1 +1 @@
-!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var f,i,u,d=0,s=[];d<t.length;d++)i=t[d],o[i]&&s.push(o[i][0]),o[i]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(r&&r(t,c,a);s.length;)s.shift()();if(a)for(d=0;d<a.length;d++)u=n(n.s=a[d]);return u};var t={},o={11:0};n.e=function(e){function r(){f.onerror=f.onload=null,clearTimeout(i);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var a=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,n.nc&&f.setAttribute("nonce",n.nc),f.src=n.p+"static/js/"+({0:"vendor-async"}[e]||e)+"."+{0:"faf63e3ae26f0c7c5766",1:"29ba346985ee6958348b",2:"81bdebc4f35de0a8e496",3:"2f8a46d076fbc01d600b",4:"39c9dbc30edffe32bf3a",5:"fcdf29e69e4f873cdb10",6:"45ae0f0f221919860a05",7:"14c6d691c1c10a72d1dd",8:"5e9c34acc2267e2a08c4"}[e]+".js";var i=setTimeout(r,12e4);return f.onerror=f.onload=r,a.appendChild(f),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);
+!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var f,i,u,d=0,s=[];d<t.length;d++)i=t[d],o[i]&&s.push(o[i][0]),o[i]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(r&&r(t,c,a);s.length;)s.shift()();if(a)for(d=0;d<a.length;d++)u=n(n.s=a[d]);return u};var t={},o={11:0};n.e=function(e){function r(){f.onerror=f.onload=null,clearTimeout(i);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var a=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,n.nc&&f.setAttribute("nonce",n.nc),f.src=n.p+"static/js/"+({0:"vendor-async"}[e]||e)+"."+{0:"faf63e3ae26f0c7c5766",1:"29ba346985ee6958348b",2:"81bdebc4f35de0a8e496",3:"2f8a46d076fbc01d600b",4:"39c9dbc30edffe32bf3a",5:"06b87ddbabe13f782089",6:"45ae0f0f221919860a05",7:"14c6d691c1c10a72d1dd",8:"5e9c34acc2267e2a08c4"}[e]+".js";var i=setTimeout(r,12e4);return f.onerror=f.onload=r,a.appendChild(f),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);

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


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


BIN
src/main/resources/static/static/media/5373_1668503119.729c22f.mp4


Some files were not shown because too many files changed in this diff