mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-25 15:10:17 +09:00
fix: #198
This commit is contained in:
parent
f676aa19af
commit
4e5bd62477
@ -180,7 +180,7 @@ export function getHeaders(ignoreHeaders?: boolean) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const isAzure = accessStore.provider === ServiceProvider.Azure;
|
const isAzure = accessStore.provider === ServiceProvider.Azure;
|
||||||
let authHeader = isAzure ? "api-key" : "Authorization";
|
let authHeader = "Authorization";
|
||||||
const apiKey = isGoogle
|
const apiKey = isGoogle
|
||||||
? accessStore.googleApiKey
|
? accessStore.googleApiKey
|
||||||
: isAzure
|
: isAzure
|
||||||
@ -195,6 +195,7 @@ export function getHeaders(ignoreHeaders?: boolean) {
|
|||||||
if (validString(apiKey)) {
|
if (validString(apiKey)) {
|
||||||
authHeader = isGoogle ? "x-goog-api-key" : authHeader;
|
authHeader = isGoogle ? "x-goog-api-key" : authHeader;
|
||||||
headers[authHeader] = makeBearer(apiKey);
|
headers[authHeader] = makeBearer(apiKey);
|
||||||
|
if (isAzure) headers["api-key"] = makeBearer(apiKey);
|
||||||
} else if (
|
} else if (
|
||||||
accessStore.enabledAccessControl() &&
|
accessStore.enabledAccessControl() &&
|
||||||
validString(accessStore.accessCode)
|
validString(accessStore.accessCode)
|
||||||
|
@ -1053,7 +1053,7 @@ export function Settings() {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={accessStore.azureApiVersion}
|
value={accessStore.azureApiVersion}
|
||||||
placeholder="2023-08-01-preview"
|
placeholder="2024-02-15-preview"
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
accessStore.update(
|
accessStore.update(
|
||||||
(access) =>
|
(access) =>
|
||||||
@ -1112,7 +1112,7 @@ export function Settings() {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={accessStore.googleApiVersion}
|
value={accessStore.googleApiVersion}
|
||||||
placeholder="2023-08-01-preview"
|
placeholder="2024-02-15-preview"
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
accessStore.update(
|
accessStore.update(
|
||||||
(access) =>
|
(access) =>
|
||||||
|
@ -29,7 +29,7 @@ const DEFAULT_ACCESS_STATE = {
|
|||||||
// azure
|
// azure
|
||||||
azureUrl: "",
|
azureUrl: "",
|
||||||
azureApiKey: "",
|
azureApiKey: "",
|
||||||
azureApiVersion: "2023-08-01-preview",
|
azureApiVersion: "2024-02-15-preview",
|
||||||
|
|
||||||
// google ai studio
|
// google ai studio
|
||||||
googleBaseUrl: "",
|
googleBaseUrl: "",
|
||||||
@ -114,7 +114,7 @@ export const useAccessStore = createPersistStore(
|
|||||||
googleApiKey: string;
|
googleApiKey: string;
|
||||||
};
|
};
|
||||||
state.openaiApiKey = state.token;
|
state.openaiApiKey = state.token;
|
||||||
state.azureApiVersion = "2023-08-01-preview";
|
state.azureApiVersion = "2024-02-15-preview";
|
||||||
state.googleApiKey = state.token;
|
state.googleApiKey = state.token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user