fix(api): support absolute paths in BaseApiClient.request()

When path starts with /api/, treat it as an absolute URL instead of
prepending baseUrl. This fixes installSkill/uninstallSkill URL
concatenation that produced /api/v1/skill-management/api/v1/skills/...
This commit is contained in:
chiguyong 2026-06-13 10:03:56 +08:00
parent 5b63214bc1
commit af50cc7fe1
1 changed files with 2 additions and 1 deletions

View File

@ -14,7 +14,8 @@ export class BaseApiClient {
}
protected async request<T>(path: string, options: RequestInit = {}): Promise<T> {
const url = `${this.baseUrl}${path}`
// If path starts with /api/, it's an absolute path — don't prepend baseUrl
const url = path.startsWith('/api/') ? path : `${this.baseUrl}${path}`
const headers: Record<string, string> = {
...options.headers as Record<string, string>,
}