refactor: 简化用户执行记录获取接口

移除getUserExecutions中的用户ID验证和路径参数,直接调用/templates/executions/user接口
This commit is contained in:
imeepos 2025-09-28 15:16:04 +08:00
parent 4cfbc8cc11
commit 01c1aa1988
1 changed files with 1 additions and 5 deletions

View File

@ -636,11 +636,7 @@ export class SdkServer {
*/
async getUserExecutions(userId?: string): Promise<UserExecution[]> {
try {
const uid = userId || Taro.getStorageSync(TOKEN_UID_KEY);
if (!uid) {
throw new Error('用户ID不存在');
}
const response = await this.request<{ executions: UserExecution[]; total: number }>(`/templates/executions/user/${uid}`);
const response = await this.request<{ executions: UserExecution[]; total: number }>(`/templates/executions/user`);
return response.data.executions || [];
} catch (error) {
throw error;