于俊龙 1 周之前
父节点
当前提交
7c86da5368

+ 2 - 2
farm-common/src/main/java/jp/yamoto/farm/common/exception/handler/GlobalExceptionHandler.java

@@ -58,7 +58,7 @@ public class GlobalExceptionHandler
     @ExceptionHandler(ServiceException.class)
     public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request)
     {
-        //log.error(e.getMessage(), e);
+        //log.error(e.getMessage());
         Integer code = e.getCode();
         return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
     }
@@ -129,7 +129,7 @@ public class GlobalExceptionHandler
     @ExceptionHandler(MethodArgumentNotValidException.class)
     public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e)
     {
-        log.error(e.getMessage(), e);
+        //log.error(e.getMessage());
         String message = e.getBindingResult().getFieldError().getDefaultMessage();
         return AjaxResult.error(message);
     }

+ 2 - 2
farm-common/src/main/java/jp/yamoto/farm/common/security/filter/JwtAuthenticationTokenFilter.java

@@ -39,7 +39,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
             if (StringUtils.isNotNull(loginUser))
             {
                 // MDCにuserIdを設定
-                MDC.put("userId", loginUser.getUsername());
+                MDC.put("userId", loginUser.getUserCode());
                 
                 if (StringUtils.isNull(SecurityUtils.getAuthentication()))
                 {
@@ -58,4 +58,4 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
             MDC.remove("userId");
         }
     }
-}
+}

+ 0 - 4
farm-crm/pom.xml

@@ -43,10 +43,6 @@
             <artifactId>farm-crm-biz</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>jp.yamoto</groupId>
-            <artifactId>farm-quartz</artifactId>
-        </dependency>
     </dependencies>
 
     <build>

+ 9 - 1
farm-sankin/src/main/java/jp/yamoto/farm/sankin/web/controller/AuthController.java

@@ -7,11 +7,13 @@ import jp.yamoto.farm.common.core.domain.model.LoginBody;
 import jp.yamoto.farm.common.core.domain.model.LoginUser;
 import jp.yamoto.farm.common.utils.SecurityUtils;
 import jp.yamoto.farm.sankin.biz.auth.domain.AuthReSendVerifyCodeBo;
-import jp.yamoto.farm.sankin.biz.auth.domain.AuthSecondVerifyBo;
 import jp.yamoto.farm.sankin.biz.auth.domain.AuthResetPwdBo;
+import jp.yamoto.farm.sankin.biz.auth.domain.AuthSecondVerifyBo;
 import jp.yamoto.farm.sankin.biz.auth.domain.AuthSendVerifyCodeBo;
 import jp.yamoto.farm.sankin.biz.auth.service.AuthService;
 import lombok.RequiredArgsConstructor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -26,6 +28,8 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/api/auth")
 public class AuthController
 {
+    private static final Logger log = LoggerFactory.getLogger(AuthController.class);
+
     @Autowired
     private AuthService authService;
 
@@ -83,6 +87,10 @@ public class AuthController
      */
     @GetMapping("userInfo")
     public AjaxResult getInfo() {
+
+        log.error("error test userinfo");
+        log.info("info test user");
+        log.warn("warn test user");
         LoginUser<FarmerUserInfo> loginUser = SecurityUtils.getLoginUser();
         FarmerUserInfo user = loginUser.getUser();