Implementation:Infiniflow Ragflow UserService
| Knowledge Sources | |
|---|---|
| Domains | Frontend, API, Authentication |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete frontend HTTP API client defining 20+ user-facing account, settings, and LLM provider endpoints for the RAGFlow frontend.
Description
The services/user-service.ts module defines API endpoint functions for: user authentication (login, register, OAuth), profile management, LLM API key configuration, system model settings, tenant info, password operations, and notification preferences. This is the most comprehensive service module covering the user account lifecycle.
Usage
Import these service functions in authentication hooks, user settings hooks, and LLM configuration components.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/services/user-service.ts
- Lines: 1-154
Signature
export const login: (data) => Promise<Response>;
export const register: (data) => Promise<Response>;
export const getUserInfo: () => Promise<Response>;
export const updateUserSetting: (data) => Promise<Response>;
export const saveLlmApiKey: (data) => Promise<Response>;
export const setSystemModel: (data) => Promise<Response>;
export const fetchRsaPublicKey: () => Promise<Response>;
// ... 15+ additional endpoints
Import
import { login, register, getUserInfo, saveLlmApiKey } from '@/services/user-service';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| data | object | Varies | Request body per endpoint |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | Promise<Response> | API response with user/settings data |
Usage Examples
import { getUserInfo, saveLlmApiKey } from '@/services/user-service';
const userInfo = await getUserInfo();
await saveLlmApiKey({ factory: 'OpenAI', api_key: 'sk-...' });