|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Utils\LogUtils;
|
|
|
|
|
|
|
|
define('HTTP_OPENAI_URL','http://openai.waimaoq.com/');
|
|
|
|
/**
|
|
|
|
* 生成路由标识
|
|
...
|
...
|
@@ -11,6 +14,22 @@ function generateRoute($string){ |
|
|
|
return trim(strtolower(preg_replace( '/[\W]+/', '-', trim($string))), '-');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 手动记录错误日志
|
|
|
|
* @param $title
|
|
|
|
* @param $params
|
|
|
|
* @param Throwable $exception
|
|
|
|
* @author zbj
|
|
|
|
* @date 2023/4/27
|
|
|
|
*/
|
|
|
|
function errorLog($title, $params, Throwable $exception){
|
|
|
|
$exceptionMessage = "错误CODE:" . $exception->getCode() .
|
|
|
|
"-----错误message:" . $exception->getMessage() .
|
|
|
|
'------错误文件:' . $exception->getFile() .
|
|
|
|
'-------错误行数:' . $exception->getLine();
|
|
|
|
|
|
|
|
LogUtils::error($title, $params, $exceptionMessage);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!function_exists('http_post')){
|
|
|
|
/**
|
...
|
...
|
|