From 89279259de2d0bea2efc5227697b30694a175f27 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Jul 2025 23:21:56 +0800 Subject: [PATCH] fix --- src/services/resourceCategoryServiceV2.ts | 29 +++++++---------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/services/resourceCategoryServiceV2.ts b/src/services/resourceCategoryServiceV2.ts index f67b673..38232f1 100644 --- a/src/services/resourceCategoryServiceV2.ts +++ b/src/services/resourceCategoryServiceV2.ts @@ -230,7 +230,7 @@ export class ResourceCategoryServiceV2 { ai_prompt: updates.ai_prompt, color: updates.color, is_active: updates.is_active, - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), verbose: false, json_output: true } @@ -257,7 +257,7 @@ export class ResourceCategoryServiceV2 { const params: CategoryDeleteRequest = { category_id: categoryId, hard_delete: hardDelete, - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), verbose: false, json_output: true } @@ -283,7 +283,7 @@ export class ResourceCategoryServiceV2 { try { const params: CategorySearchRequest = { query, - user_id: this.defaultUserId, + user_id: this.getCurrentUserId(), include_cloud: true, limit: 50, verbose: false, @@ -312,7 +312,7 @@ export class ResourceCategoryServiceV2 { try { const params: CategoryColorRequest = { color, - user_id: this.defaultUserId, + user_id: this.getCurrentUserId(), include_cloud: true, limit: 50, verbose: false, @@ -366,7 +366,7 @@ export class ResourceCategoryServiceV2 { try { const params: CategoryBatchCreateRequest = { categories, - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), verbose: false, json_output: true } @@ -391,7 +391,7 @@ export class ResourceCategoryServiceV2 { static async getCategoryCount(includeCloud = true, userId?: string): Promise { try { const params: CategoryListRequest = { - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), include_cloud: includeCloud, verbose: false, json_output: true @@ -418,7 +418,7 @@ export class ResourceCategoryServiceV2 { try { const params: CategoryGetRequest = { category_id: categoryId, - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), verbose: false, json_output: true } @@ -444,7 +444,7 @@ export class ResourceCategoryServiceV2 { try { const params: CategoryGetRequest = { category_id: categoryId, - user_id: userId || this.defaultUserId, + user_id: userId || this.getCurrentUserId(), verbose: false, json_output: true } @@ -463,17 +463,4 @@ export class ResourceCategoryServiceV2 { } } - /** - * 设置默认用户ID - */ - static setDefaultUserId(userId: string) { - this.defaultUserId = userId - } - - /** - * 获取默认用户ID - */ - static getDefaultUserId(): string { - return this.defaultUserId - } }