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[]> {
|
async getUserExecutions(userId?: string): Promise<UserExecution[]> {
|
||||||
try {
|
try {
|
||||||
const uid = userId || Taro.getStorageSync(TOKEN_UID_KEY);
|
const response = await this.request<{ executions: UserExecution[]; total: number }>(`/templates/executions/user`);
|
||||||
if (!uid) {
|
|
||||||
throw new Error('用户ID不存在');
|
|
||||||
}
|
|
||||||
const response = await this.request<{ executions: UserExecution[]; total: number }>(`/templates/executions/user/${uid}`);
|
|
||||||
return response.data.executions || [];
|
return response.data.executions || [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue