feat: initialize new React application structure with TypeScript, ESLint, and Prettier configurations, while removing legacy files and adding new components and pages for enhanced functionality

This commit is contained in:
Supra4E8C
2025-12-07 11:32:31 +08:00
parent 8e4132200d
commit 450964fb1a
144 changed files with 14223 additions and 21647 deletions

27
src/services/api/oauth.ts Normal file
View File

@@ -0,0 +1,27 @@
/**
* OAuth 与设备码登录相关 API
*/
import { apiClient } from './client';
export type OAuthProvider =
| 'codex'
| 'anthropic'
| 'antigravity'
| 'gemini-cli'
| 'qwen'
| 'iflow';
export interface OAuthStartResponse {
url: string;
state?: string;
}
export const oauthApi = {
startAuth: (provider: OAuthProvider) => apiClient.get<OAuthStartResponse>(`/${provider}-auth-url`, { params: { is_webui: 1 } }),
getAuthStatus: (state: string) =>
apiClient.get<{ status: 'ok' | 'wait' | 'error'; error?: string }>(`/get-auth-status`, {
params: { state }
})
};