Download apps/web-ele/src/api/core/auth.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 683 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/web-ele/src/api/core/auth.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/apps/web-ele/src/api/core/auth.ts
-
curl -L -o auth.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/web-ele/src/api/core/auth.ts
683 Bytes
| import { baseRequestClient, requestClient } from '#/api/request'; | |
| export namespace AuthApi { | |
| export interface LoginParams { | |
| password?: string; | |
| username?: string; | |
| } | |
| export interface LoginResult { | |
| accessToken: string; | |
| } | |
| } | |
| export async function loginApi(data: AuthApi.LoginParams) { | |
| return requestClient.post<AuthApi.LoginResult>('/admin/auth/login', data); | |
| } | |
| export async function logoutApi() { | |
| return baseRequestClient.post('/admin/auth/logout'); | |
| } | |
| export async function getAccessCodesApi() { | |
| return requestClient.get<string[]>('/admin/auth/codes'); | |
| } | |
| export async function refreshTokenApi() { | |
| return baseRequestClient.post('/admin/auth/refresh'); | |
| } | |