瀏覽代碼

上报错误ip

zhaoyang 1 年之前
父節點
當前提交
00810509e8
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/Libs/Helpers.php

+ 4 - 0
app/Libs/Helpers.php

@@ -457,6 +457,10 @@ function dingTalkAlertException(\Throwable $exception)
         $ip = isset($ssh_list[2]) ? $ssh_list[2]:'';
     }
 
+    if(!$ip){
+        $ip = trim( shell_exec("  eth0 |grep 'inet ' 2>/dev/null  |awk '{print $2}' ") );
+    }
+
     $result = [
         'message'=>$exception->getMessage(),
         'class_name'=>$class_name,