mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-11 20:43:42 +08:00
Merge branch 'main' of https://github.com/Yidadaa/ChatGPT-Next-Web
This commit is contained in:
@@ -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}`;
|
||||
|
@@ -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";
|
||||
|
||||
|
@@ -6,5 +6,7 @@ export function ensure<T extends object>(
|
||||
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] !== "",
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user