refactor: 简化用户执行记录获取接口
移除getUserExecutions中的用户ID验证和路径参数,直接调用/templates/executions/user接口
This commit is contained in:
parent
4cfbc8cc11
commit
01c1aa1988
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue