mirror of https://github.com/halo-dev/halo
fix: resolve potential exception during bulk image upload in post creation (#6276)
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/6297/head
parent
104bd3e44e
commit
ed5f9aeb50
|
@ -431,9 +431,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) {
|
||||||
if (!currentUserHasPermission(["uc:attachments:manage"])) {
|
if (!currentUserHasPermission(["uc:attachments:manage"])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isUpdateMode.value) {
|
|
||||||
await handleSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
||||||
{
|
{
|
||||||
|
|
|
@ -456,10 +456,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isUpdateMode.value) {
|
|
||||||
await handleSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
||||||
{
|
{
|
||||||
file,
|
file,
|
||||||
|
|
|
@ -422,9 +422,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) {
|
||||||
if (!currentUserHasPermission(["uc:attachments:manage"])) {
|
if (!currentUserHasPermission(["uc:attachments:manage"])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isUpdateMode.value) {
|
|
||||||
await handleCreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue