diff --git a/src/backend/services/core.service.ts b/src/backend/services/core.service.ts index 17ddd51..aa8bcea 100644 --- a/src/backend/services/core.service.ts +++ b/src/backend/services/core.service.ts @@ -162,10 +162,17 @@ export class CoreService { } async callPluginApi(pluginId: string, path: string, body?: any): Promise { - return this.fetchCore(`/api/plugins/rpc/${pluginId}/${path.replace(/^\//, '')}`, { + const res = await this.fetchCore(`/api/plugins/rpc/${pluginId}/${path.replace(/^\//, '')}`, { method: 'POST', body: body !== undefined ? JSON.stringify(body) : undefined, }); + if (res && typeof res === 'object' && res.success === true) { + if (res.data && typeof res.data === 'object' && res.data.success === true) { + return res.data.data as T; + } + return res.data as T; + } + return res as T; } async callAsService(pluginId: string, path: string, body?: any): Promise {