From cb140e482f522b5add2f31b42d80eda471764335 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Fri, 10 Nov 2023 15:15:43 +0800 Subject: [PATCH 1/5] fix: #3207 ensure corner case --- README_CN.md | 2 +- app/utils/clone.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index c82dfc044e7..72376374f86 100644 --- a/README_CN.md +++ b/README_CN.md @@ -138,7 +138,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro OPENAI_API_KEY= # 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址 -BASE_URL=https://nb.nextweb.fun/api/proxy +BASE_URL=https://ab.nextweb.fun/api/proxy ``` ### 本地开发 diff --git a/app/utils/clone.ts b/app/utils/clone.ts index c42288f7789..e4cd291111d 100644 --- a/app/utils/clone.ts +++ b/app/utils/clone.ts @@ -6,5 +6,7 @@ export function ensure( obj: T, keys: Array<[keyof T][number]>, ) { - return keys.every((k) => obj[k] !== undefined && obj[k] !== null); + return keys.every( + (k) => obj[k] !== undefined && obj[k] !== null && obj[k] !== "", + ); } From 2bfb362832eab66533eba1e455cec28762e86405 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 10 Nov 2023 15:19:31 +0800 Subject: [PATCH 2/5] Update tauri.conf.json --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 649e3816db3..397ae0d8345 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "ChatGPT Next Web", - "version": "2.9.10" + "version": "2.9.11" }, "tauri": { "allowlist": { From 6b2db97347b4bc260146712997be1549c4968ec5 Mon Sep 17 00:00:00 2001 From: Ensteinjun Date: Fri, 10 Nov 2023 15:44:07 +0800 Subject: [PATCH 3/5] fixbug --- app/api/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index fc877b02db2..adec611b2b3 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -18,7 +18,7 @@ export async function requestOpenai(req: NextRequest) { ); let baseUrl = - serverConfig.azureUrl ?? serverConfig.baseUrl ?? OPENAI_BASE_URL; + serverConfig.azureUrl || serverConfig.baseUrl || OPENAI_BASE_URL; if (!baseUrl.startsWith("http")) { baseUrl = `https://${baseUrl}`; From ca792669fce17493a58be64ec2388b4e9db9abb5 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 10 Nov 2023 18:20:51 +0800 Subject: [PATCH 4/5] Update constant.ts --- app/constant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/constant.ts b/app/constant.ts index fbc0c72e378..561899769d4 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -8,7 +8,7 @@ export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/c export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`; export const RUNTIME_CONFIG_DOM = "danger-runtime-config"; -export const DEFAULT_CORS_HOST = "https://ab.nextweb.fun"; +export const DEFAULT_CORS_HOST = "https://a.nextweb.fun"; export const DEFAULT_API_HOST = `${DEFAULT_CORS_HOST}/api/proxy`; export const OPENAI_BASE_URL = "https://api.openai.com"; From 943214c6a78bf3b9c6ed12e029efa682adaee659 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 10 Nov 2023 18:21:22 +0800 Subject: [PATCH 5/5] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 72376374f86..604771c5251 100644 --- a/README_CN.md +++ b/README_CN.md @@ -138,7 +138,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro OPENAI_API_KEY= # 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址 -BASE_URL=https://ab.nextweb.fun/api/proxy +BASE_URL=https://a.nextweb.fun/api/proxy ``` ### 本地开发