fix: fix add api auth

This commit is contained in:
Fred Liang
2023-12-24 03:05:23 +08:00
parent 45798f993d
commit 4169431f2c
3 changed files with 7 additions and 10 deletions

View File

@@ -145,8 +145,8 @@ export function getHeaders() {
"Content-Type": "application/json",
"x-requested-with": "XMLHttpRequest",
};
const isGoogle = accessStore.provider === ServiceProvider.Google;
const modelConfig = useChatStore.getState().currentSession().mask.modelConfig;
const isGoogle = modelConfig.model === "gemini";
const isAzure = accessStore.provider === ServiceProvider.Azure;
const authHeader = isAzure ? "api-key" : "Authorization";
const apiKey = isGoogle