From 8b0cf7d248bd3582c619f9337f711076caa75532 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 16 May 2023 00:22:11 +0800 Subject: [PATCH] fix: #1509 openai url split --- app/client/platforms/openai.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 4bdf9e05..a69e8e3c 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -10,8 +10,10 @@ export class ChatGPTApi implements LLMApi { public SubsPath = "dashboard/billing/subscription"; path(path: string): string { - const openaiUrl = useAccessStore.getState().openaiUrl; - if (openaiUrl.endsWith("/")) openaiUrl.slice(0, openaiUrl.length - 1); + let openaiUrl = useAccessStore.getState().openaiUrl; + if (openaiUrl.endsWith("/")) { + openaiUrl = openaiUrl.slice(0, openaiUrl.length - 1); + } return [openaiUrl, path].join("/"); }