Compare commits
2 Commits
457e69f46b
...
33efcffcaa
| Author | SHA1 | Date |
|---|---|---|
|
|
33efcffcaa | |
|
|
a6ea36f11f |
|
|
@ -17,6 +17,16 @@ export abstract class N8nImageGenerateTemplate extends ImageGenerateTemplate {
|
||||||
"image_url": imageUrl
|
"image_url": imageUrl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).then(res => res.data).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
const data = res.data;
|
||||||
|
if (!data) throw new Error(`结果有误`)
|
||||||
|
if (Array.isArray(data) && data.length > 0) {
|
||||||
|
return data[0];
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
throw new Error(res.msg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,6 +58,16 @@ export abstract class N8nVideoGenerateTemplate extends VideoGenerateTemplate {
|
||||||
"aspect_ratio": this.aspectRatio
|
"aspect_ratio": this.aspectRatio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).then(res => res.data).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
const data = res.data;
|
||||||
|
if (!data) throw new Error(`结果有误`)
|
||||||
|
if (Array.isArray(data) && data.length > 0) {
|
||||||
|
return data[0];
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
throw new Error(res.msg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue