代码提交优化

This commit is contained in:
wong
2025-11-03 14:06:58 +08:00
parent e3afa24795
commit 367a76a54f
9 changed files with 444 additions and 64 deletions

View File

@@ -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' => '提示词缺失']);
}