ソースを参照

微信移动端支付

guomengjiao 5 ヶ月 前
コミット
eddd91fb87
共有2 個のファイルを変更した41 個の追加25 個の削除を含む
  1. 11 25
      .idea/workspace.xml
  2. 30 0
      modules/core/src/main/java/com/jeesite/modules/exception/JeesiteExceptionHandler.java

+ 11 - 25
.idea/workspace.xml

@@ -29,8 +29,8 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="fc9366aa-6566-4981-8149-d75e02f8e884" name="默认的" comment="微信移动端支付">
+      <change afterPath="$PROJECT_DIR$/modules/core/src/main/java/com/jeesite/modules/exception/JeesiteExceptionHandler.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/modules/report/src/main/java/com/jeesite/modules/report/service/ResearchBriefReportService.java" beforeDir="false" afterPath="$PROJECT_DIR$/modules/report/src/main/java/com/jeesite/modules/report/service/ResearchBriefReportService.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -111,11 +111,11 @@
       <recent name="D:\Git\xiangxi\bjfl_web\modules\basedata\src\main\resources\mappings\modules\basedata" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.jeesite.modules.exception" />
       <recent name="com.jeesite.modules.report.service" />
       <recent name="com.jeesite.modules.report.util" />
       <recent name="com.jeesite.modules.sys.utils" />
       <recent name="com.jeesite.modules.bjflapi.report" />
-      <recent name="com.jeesite.modules.report.dto" />
     </key>
   </component>
   <component name="RunAnythingCache">
@@ -458,14 +458,7 @@
       <workItem from="1735970618647" duration="252000" />
       <workItem from="1735970895886" duration="8433000" />
       <workItem from="1736126123480" duration="510000" />
-      <workItem from="1736127959643" duration="30936000" />
-    </task>
-    <task id="LOCAL-00031" summary="简报">
-      <created>1734765445609</created>
-      <option name="number" value="00031" />
-      <option name="presentableId" value="LOCAL-00031" />
-      <option name="project" value="LOCAL" />
-      <updated>1734765445609</updated>
+      <workItem from="1736127959643" duration="35881000" />
     </task>
     <task id="LOCAL-00032" summary="用户订单">
       <created>1734768659538</created>
@@ -803,7 +796,14 @@
       <option name="project" value="LOCAL" />
       <updated>1736218026787</updated>
     </task>
-    <option name="localTasksCounter" value="80" />
+    <task id="LOCAL-00080" summary="微信移动端支付">
+      <created>1736232303457</created>
+      <option name="number" value="00080" />
+      <option name="presentableId" value="LOCAL-00080" />
+      <option name="project" value="LOCAL" />
+      <updated>1736232303457</updated>
+    </task>
+    <option name="localTasksCounter" value="81" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -886,20 +886,6 @@
     <option name="LAST_COMMIT_MESSAGE" value="微信移动端支付" />
   </component>
   <component name="XDebuggerManager">
-    <breakpoint-manager>
-      <breakpoints>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/modules/report/src/main/java/com/jeesite/modules/report/service/ResearchBriefReportService.java</url>
-          <line>272</line>
-          <option name="timeStamp" value="2" />
-        </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/modules/bjflapi/src/main/java/com/jeesite/modules/bjflapi/report/WebsiteUserControllerApi.java</url>
-          <line>207</line>
-          <option name="timeStamp" value="8" />
-        </line-breakpoint>
-      </breakpoints>
-    </breakpoint-manager>
     <watches-manager>
       <configuration name="SpringBootApplicationConfigurationType">
         <watch expression="query" />

+ 30 - 0
modules/core/src/main/java/com/jeesite/modules/exception/JeesiteExceptionHandler.java

@@ -0,0 +1,30 @@
+package com.jeesite.modules.exception;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.web.http.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * 异常处理器
+ *
+ * @Author scott
+ * @Date 2019
+ */
+@RestControllerAdvice
+@Slf4j
+public class JeesiteExceptionHandler {
+
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public String handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+        log.error(e.getMessage(), e);
+        String message = e.getBindingResult().getFieldError().getDefaultMessage();
+        return ServletUtils.renderResult(Global.FALSE, message, null);
+    }
+
+}