优化:AI小助手在线列表样式改为与普通用户一致

This commit is contained in:
2026-02-26 21:46:25 +08:00
parent fd3214eaff
commit 5d722bbb0b
2 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -133,7 +133,11 @@ PROMPT;
{
$startTime = microtime(true);
$apiKey = $config->getDecryptedApiKey();
$endpoint = rtrim($config->api_endpoint, '/').'/v1/chat/completions';
// 智能拼接 URL:如果端点已包含 /v1,则只追加 /chat/completions
$base = rtrim($config->api_endpoint, '/');
$endpoint = str_ends_with($base, '/v1')
? $base.'/chat/completions'
: $base.'/v1/chat/completions';
try {
$response = Http::withToken($apiKey)