Browse Source

优化

tags/正式3.13.0
王宁 1 year ago
parent
commit
384188a786
1 changed files with 7 additions and 8 deletions
  1. 7
    8
      suser/src/main/java/com/xhkjedu/suser/aop/WebControllerAop.java

+ 7
- 8
suser/src/main/java/com/xhkjedu/suser/aop/WebControllerAop.java View File

@@ -135,7 +135,7 @@ public class WebControllerAop {
135 135
      * @Param [ret]
136 136
      **/
137 137
     @AfterReturning(returning = "ret", pointcut = "handleLog()")
138
-    public void doAfterReturning(Object ret) throws Throwable {
138
+    public void doAfterReturning(Object ret){
139 139
         if (ret == null) {
140 140
             return;
141 141
         }
@@ -157,10 +157,10 @@ public class WebControllerAop {
157 157
      * @Description  后置异常
158 158
      * @Date 2023/11/15 17:47:28
159 159
      * @Author WN
160
-     * @Param [jp, e]
160
+     * @Param [jp, e] (JoinPoint jp, Exception e)
161 161
      **/
162 162
     @AfterThrowing(pointcut = "handleLog()", throwing = "e")
163
-    public void throwss(JoinPoint jp, Exception e) {
163
+    public void throwss(Exception e) {
164 164
 
165 165
         if (handleLog == null) {
166 166
             return;
@@ -168,17 +168,17 @@ public class WebControllerAop {
168 168
 
169 169
         handleLog.setHandlestate(2);
170 170
 
171
-        log.info("方法异常时执行.....");
171
+        log.info("方法异常时执行....." + e.getMessage());
172 172
     }
173 173
 
174 174
     /*
175 175
      * @Description 后置最终通知,final增强,不管是抛出异常或者正常退出都会执行
176 176
      * @Date 2023/11/15 17:49:15
177 177
      * @Author WN
178
-     * @Param [jp]
178
+     * @Param [JoinPoint jp]
179 179
      **/
180 180
     @After("handleLog()")
181
-    public void after(JoinPoint jp) {
181
+    public void after() {
182 182
         if (handleLog == null) {
183 183
             return;
184 184
         }
@@ -196,8 +196,7 @@ public class WebControllerAop {
196 196
     @Around("handleLog()")
197 197
     public Object arround(ProceedingJoinPoint pjp) {
198 198
         try {
199
-            Object o = pjp.proceed();
200
-            return o;
199
+            return pjp.proceed();
201 200
         } catch (Throwable e) {
202 201
             e.printStackTrace();
203 202
             if (e instanceof Exception) {

Loading…
Cancel
Save