Browse Source

异常上报

zhaoyang 1 year ago
parent
commit
5757e6f584
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Libs/Helpers.php

+ 2 - 2
app/Libs/Helpers.php

@@ -439,12 +439,12 @@ function dingTalkAlertException(\Throwable $exception)
     $url .= '&'.http_build_query(['timestamp'=>$timestamp,'sign'=>$sign]);
     $url .= '&'.http_build_query(['timestamp'=>$timestamp,'sign'=>$sign]);
 
 
     $class_name = get_class($exception);
     $class_name = get_class($exception);
-    $app_path = app_path();
+    $app_path = base_path();
     $trace = $exception->getTraceAsString();
     $trace = $exception->getTraceAsString();
     $trace_list = preg_split('/\n/',$trace);
     $trace_list = preg_split('/\n/',$trace);
     $error = '- '.$exception->getFile().':'.$exception->getLine()."\n";
     $error = '- '.$exception->getFile().':'.$exception->getLine()."\n";
     foreach($trace_list as $item){
     foreach($trace_list as $item){
-        if( Str::contains($item,$app_path)){
+        if( !Str::contains($item,'vendor')){
             $error .= '- '.trim(preg_replace('/^(\#\d+)/','',$item))."\n";
             $error .= '- '.trim(preg_replace('/^(\#\d+)/','',$item))."\n";
         }
         }
     }
     }