作者 赵彬吉

update

<?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')){
/**
... ...
... ... @@ -62,6 +62,7 @@ class ServerConfigLogic extends BaseLogic
DB::commit();
} catch (\Exception $e) {
DB::rollBack();
errorLog('项目运维服务配置保存失败', $param, $e);
$this->fail('保存失败');
}
return $this->success();
... ...
... ... @@ -50,6 +50,7 @@ class ProjectLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
errorLog('项目保存失败', $param, $e);
$this->fail('保存失败');
}
return $this->success();
... ...
... ... @@ -60,6 +60,7 @@ class AttrLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
errorLog('产品参数保存失败', $param, $e);
$this->fail('保存失败');
}
return $this->success();
... ...
... ... @@ -33,6 +33,7 @@ class KeywordLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
errorLog('产品关键词保存失败', $param, $e);
$this->fail('保存失败');
}
return $this->success();
... ...
... ... @@ -39,6 +39,7 @@ class ProductLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
errorLog('产品保存失败', $param, $e);
$this->fail('保存失败');
}
return $this->success();
... ...