mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 02:30:51 +08:00
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:
27
src/services/api/oauth.ts
Normal file
27
src/services/api/oauth.ts
Normal 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 }
|
||||
})
|
||||
};
|
||||
Reference in New Issue
Block a user