mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-05 01:02:59 +08:00
add plan activity config (#6139)
* activity points * modal * ui * fix * pref: zod schema * perf: ad api with zod * perf: plan year switch * perf: plan * i18n * fix: hook * fix: activity checker * fix: i18n * fix clear token * fix * back * can close modal in pay * ad token * rename * fix * total points * eng i18n --------- Co-authored-by: archer <545436317@qq.com>
This commit is contained in:
@@ -8,7 +8,17 @@ import { imageBaseUrl } from '@fastgpt/global/common/file/image/constants';
|
||||
|
||||
export const useUploadAvatar = (
|
||||
api: (params: { filename: string }) => Promise<CreatePostPresignedUrlResult>,
|
||||
{ onSuccess }: { onSuccess?: (avatar: string) => void } = {}
|
||||
{
|
||||
onSuccess,
|
||||
maxW = 300,
|
||||
maxH = 300,
|
||||
maxSize = 1024 * 500 // 500KB
|
||||
}: {
|
||||
onSuccess?: (avatar: string) => void;
|
||||
maxW?: number;
|
||||
maxH?: number;
|
||||
maxSize?: number;
|
||||
} = {}
|
||||
) => {
|
||||
const { toast } = useToast();
|
||||
const { t } = useTranslation();
|
||||
@@ -32,8 +42,9 @@ export const useUploadAvatar = (
|
||||
const compressed = base64ToFile(
|
||||
await compressBase64Img({
|
||||
base64Img: await fileToBase64(file),
|
||||
maxW: 300,
|
||||
maxH: 300
|
||||
maxW,
|
||||
maxH,
|
||||
maxSize
|
||||
}),
|
||||
file.name
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user