Skip to content

Commit

Permalink
fix: support pandoar-next
Browse files Browse the repository at this point in the history
closes #194
  • Loading branch information
pionxzh committed Dec 24, 2023
1 parent 743c38e commit 2d8a6ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/api.ts
Expand Up @@ -331,7 +331,8 @@ async function fetchApi<T>(url: string, options?: RequestInit): Promise<T> {
const response = await fetch(url, {
...options,
headers: {
Authorization: `Bearer ${accessToken}`,
'Authorization': `Bearer ${accessToken}`,
'X-Authorization': `Bearer ${accessToken}`,
...options?.headers,
},
})
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
@@ -1,6 +1,7 @@
const API_MAPPING: Record<string, string> = {
'https://chat.openai.com': 'https://chat.openai.com/backend-api',
'https://chat.zhile.io': 'https://proxy1.fakegpt.org/api',
'https://chat.zhile.io': 'https://chat.zhile.io/backend-api',
'https://chat.oaifree.com': 'https://chat.oaifree.com/backend-api',
}

// export const baseUrl = 'https://chat.openai.com'
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Expand Up @@ -48,6 +48,12 @@ export default defineConfig({
'https://chat.zhile.io/c/*',
'https://chat.zhile.io/share/*',
'https://chat.zhile.io/share/*/continue',

'https://chat.oaifree.com/',
'https://chat.oaifree.com/?model=*',
'https://chat.oaifree.com/c/*',
'https://chat.oaifree.com/share/*',
'https://chat.oaifree.com/share/*/continue',
],
'icon': 'https://chat.openai.com/favicon.ico',
'run-at': 'document-end',
Expand Down

0 comments on commit 2d8a6ce

Please sign in to comment.