diff --git a/src/meilisearch_endpoint/index.ts b/src/meilisearch_endpoint/index.ts index db4ce2f..583f346 100644 --- a/src/meilisearch_endpoint/index.ts +++ b/src/meilisearch_endpoint/index.ts @@ -118,11 +118,11 @@ export default defineEndpoint({ if (meiliConfigs.length === 0) { return res.status(500).json({ success: false, message: 'MeiliSearch 全局配置未设置' }); } - const { host, apiKey } = meiliConfigs[0] || { host: '', apiKey: '' }; + const { host, api_key } = meiliConfigs[0] || { host: '', api_key: '' }; const client = new MeiliSearch({ - host, - apiKey, + host: host, + apiKey: api_key, }) const result: any[] = []; diff --git a/src/types/meilisearch.ts b/src/types/meilisearch.ts index 4d983c9..1ecd6ce 100644 --- a/src/types/meilisearch.ts +++ b/src/types/meilisearch.ts @@ -3,7 +3,7 @@ */ export interface MeiliSearchConfig { host: string; - apiKey: string; + api_key: string; } /**