mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
Replace data: object with precise parameter types derived from call sites, using type inference (Omit/union) over bulk interface declarations where possible. Covers accounts, api-keys, usage, system, auth, dashboard, settings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
41 lines
682 B
TypeScript
41 lines
682 B
TypeScript
import request from '../request'
|
|
|
|
export interface LoginResponse {
|
|
expiresAt: string
|
|
}
|
|
|
|
export interface AuthStatusResponse {
|
|
authenticated: boolean
|
|
}
|
|
|
|
export interface LogoutResponse {
|
|
message: string
|
|
}
|
|
|
|
interface LoginParam {
|
|
username: string
|
|
password: string
|
|
}
|
|
|
|
export function login(data: LoginParam) {
|
|
return request<LoginResponse>({
|
|
url: '/api/admin/auth/login',
|
|
method: 'POST',
|
|
data,
|
|
})
|
|
}
|
|
|
|
export function getAuthStatus() {
|
|
return request<AuthStatusResponse>({
|
|
url: '/api/admin/auth/status',
|
|
method: 'GET',
|
|
})
|
|
}
|
|
|
|
export function logout() {
|
|
return request<LogoutResponse>({
|
|
url: '/api/admin/auth/logout',
|
|
method: 'POST',
|
|
})
|
|
}
|