diff --git a/README_CN.md b/README_CN.md index c82dfc044..604771c52 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://a.nextweb.fun/api/proxy ``` ### 本地开发 diff --git a/app/api/common.ts b/app/api/common.ts index fc877b02d..adec611b2 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}`; diff --git a/app/config/server.ts b/app/config/server.ts index 29e0b78fd..5e7ef4d91 100644 --- a/app/config/server.ts +++ b/app/config/server.ts @@ -13,11 +13,11 @@ declare global { OPENAI_ORG_ID?: string; // openai only VERCEL?: "1" | undefined; + BUILD_MODE?: "standalone" | "export"; + BUILD_APP?: string; // is building desktop app HIDE_USER_API_KEY?: string; // disable user's api key input DISABLE_GPT4?: string; // allow user to use gpt-4 or not - BUILD_MODE?: "standalone" | "export"; - BUILD_APP?: string; // is building desktop app ENABLE_BALANCE_QUERY?: string; // allow user to query balance or not DISABLE_FAST_LINK?: string; // disallow parse settings from url or not CUSTOM_MODELS?: string; // to control custom models diff --git a/app/constant.ts b/app/constant.ts index ac0ebf4c7..15bf6bcb3 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"; diff --git a/app/utils/clone.ts b/app/utils/clone.ts index 0b03b378b..e4cd29111 100644 --- a/app/utils/clone.ts +++ b/app/utils/clone.ts @@ -1,3 +1,12 @@ export function deepClone(obj: T) { return JSON.parse(JSON.stringify(obj)); -} \ No newline at end of file +} + +export function ensure( + obj: T, + keys: Array<[keyof T][number]>, +) { + return keys.every( + (k) => obj[k] !== undefined && obj[k] !== null && obj[k] !== "", + ); +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 649e3816d..397ae0d83 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": {