mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 15:57:54 +08:00
feat: add claude and bard
This commit is contained in:
@@ -6,23 +6,22 @@ export function bearer(value: string) {
|
||||
return `Bearer ${value.trim()}`;
|
||||
}
|
||||
|
||||
export function getAuthHeaders(apiKey = "") {
|
||||
export function getAuthKey(apiKey = "") {
|
||||
const accessStore = useAccessStore.getState();
|
||||
const isApp = !!getClientConfig()?.isApp;
|
||||
|
||||
let headers: Record<string, string> = {};
|
||||
let authKey = "";
|
||||
|
||||
if (apiKey) {
|
||||
// use user's api key first
|
||||
headers.Authorization = bearer(apiKey);
|
||||
authKey = bearer(apiKey);
|
||||
} else if (
|
||||
accessStore.enabledAccessControl() &&
|
||||
!isApp &&
|
||||
!!accessStore.accessCode
|
||||
) {
|
||||
// or use access code
|
||||
headers.Authorization = bearer(ACCESS_CODE_PREFIX + accessStore.accessCode);
|
||||
authKey = bearer(ACCESS_CODE_PREFIX + accessStore.accessCode);
|
||||
}
|
||||
|
||||
return headers;
|
||||
return authKey;
|
||||
}
|
||||
|
@@ -1,5 +0,0 @@
|
||||
export const COMMON_PROVIDER_CONFIG = {
|
||||
customModels: "",
|
||||
models: [] as string[],
|
||||
autoFetchModels: false, // fetch available models from server or not
|
||||
};
|
Reference in New Issue
Block a user