From e184b1e3a99f461c5a7fcd85cda26f9c728f55d5 Mon Sep 17 00:00:00 2001 From: wood Date: Thu, 9 Nov 2023 04:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=98=E9=87=8F=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 -- static/js.js | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 8bda51e..9cc41c7 100644 --- a/index.html +++ b/index.html @@ -61,8 +61,6 @@ onchange="toggleCustomUrlInput()"> [官网线路]api.openai.com [CZLoapi线路]oapi.czl.net - [Cloudflare网关]不封号,查不了已用量 [群友CF反代]openai.996.lat [已前置https]自定义 diff --git a/static/js.js b/static/js.js index 8f68201..d8cd1c0 100644 --- a/static/js.js +++ b/static/js.js @@ -348,15 +348,13 @@ function sendRequest() { }) return; } else { - const apiUrl = customUrlInput.value.trim(); + apiUrl = customUrlInput.value.trim(); if (!apiUrl.startsWith("http://") && !apiUrl.startsWith("https://")) { apiUrl = "https://" + apiUrl; } - if (apiUrl.startsWith("https://gateway.ai.cloudflare.com")) { - apiUrl = apiUrl; // 如果用户输入的是https://gateway.ai.cloudflare.com开头,则不添加/v1 - } else { + if (!apiUrl.startsWith("https://gateway.ai.cloudflare.com")) { apiUrl += "/v1"; // 如果不是,则添加路径‘/v1’ } } @@ -371,6 +369,7 @@ function sendRequest() { } + let apiKeys = parseKeys(apiKeyInput.value); mdui.alert({