chore: updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { FC, useState, useEffect } from "react";
|
import { FC, useState, useEffect, memo } from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { Ring } from "@uiball/loaders";
|
import { Ring } from "@uiball/loaders";
|
||||||
import Button from "./styled/Button";
|
import Button from "./styled/Button";
|
||||||
@@ -39,4 +39,4 @@ const Loading: FC<Props> = ({ reload = false, fullscreen = false }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Loading;
|
export default memo(Loading);
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ const useUploadFile = (props?: IProps) => {
|
|||||||
type: file_type,
|
type: file_type,
|
||||||
size: file_size
|
size: file_size
|
||||||
} = file;
|
} = file;
|
||||||
// 拿file id
|
// 生成 file id
|
||||||
const resp = await prepareUploadFile({
|
const resp = await prepareUploadFile({
|
||||||
content_type: file_type,
|
content_type: file_type,
|
||||||
filename: name
|
filename: name
|
||||||
});
|
});
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
toast.error("Prepare Upload File Error");
|
// toast.error("Prepare Upload File Error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const file_id = resp.data;
|
const file_id = resp.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user