代码提交优化
This commit is contained in:
@@ -4,15 +4,18 @@ namespace app\ai\controller;
|
||||
|
||||
use app\common\util\JwtUtil;
|
||||
use think\facade\Env;
|
||||
use think\Controller;
|
||||
|
||||
class DouBaoAI
|
||||
class DouBaoAI extends Controller
|
||||
{
|
||||
protected $apiUrl;
|
||||
protected $apiKey;
|
||||
protected $headers;
|
||||
|
||||
public function __init()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->apiUrl = Env::get('doubaoAi.api_url');
|
||||
$this->apiKey = Env::get('doubaoAi.api_key');
|
||||
|
||||
@@ -31,7 +34,7 @@ class DouBaoAI
|
||||
|
||||
public function text($params = [])
|
||||
{
|
||||
$this->__init();
|
||||
|
||||
if (empty($params)){
|
||||
return json_encode(['code' => 500, 'msg' => '提示词缺失']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user