Refactor user REST API (#14334)

### What problem does this PR solve?
Refactor user REST API

### Type of change
- [x] Refactoring
This commit is contained in:
Wang Qi
2026-04-24 10:25:15 +08:00
committed by GitHub
parent c41b5e8a5d
commit 199fbceb72
17 changed files with 58 additions and 507 deletions

View File

@@ -5,15 +5,15 @@ export { restAPIv1, webAPI };
export default {
// user
login: `${webAPI}/user/login`,
logout: `${webAPI}/user/logout`,
register: `${webAPI}/user/register`,
setting: `${webAPI}/user/setting`,
userInfo: `${webAPI}/user/info`,
tenantInfo: `${webAPI}/user/tenant_info`,
setTenantInfo: `${webAPI}/user/set_tenant_info`,
loginChannels: `${webAPI}/user/login/channels`,
loginChannel: (channel: string) => `${webAPI}/user/login/${channel}`,
login: `${restAPIv1}/auth/login`,
logout: `${restAPIv1}/auth/logout`,
register: `${restAPIv1}/users`,
setting: `${restAPIv1}/users/me`,
userInfo: `${restAPIv1}/users/me`,
tenantInfo: `${restAPIv1}/users/me/models`,
setTenantInfo: `${restAPIv1}/users/me/models`,
loginChannels: `${restAPIv1}/auth/login/channels`,
loginChannel: (channel: string) => `${restAPIv1}/auth/login/${channel}`,
// team
addTenantUser: (tenantId: string) => `${restAPIv1}/tenants/${tenantId}/users`,

View File

@@ -78,7 +78,7 @@ const modelParamMap: ModelParamMap = {
// API endpoint whitelist - only these endpoints will have tenant parameters added
const API_WHITELIST = [
'/v1/user/set_tenant_info',
'/api/v1/users/me/models',
'/api/v1/chats',
'/v1/canvas/set',
'/v1/canvas/setting',