mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
V4.6.7-production (#759)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useDisclosure, Button, ModalBody, ModalFooter } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import MyModal from '@/components/MyModal';
|
||||
@@ -35,7 +35,7 @@ export const useConfirm = (props?: {
|
||||
content,
|
||||
showCancel = true
|
||||
} = props || {};
|
||||
const [customContent, setCustomContent] = useState(content);
|
||||
const [customContent, setCustomContent] = useState<string | React.ReactNode>(content);
|
||||
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
|
||||
@@ -44,7 +44,7 @@ export const useConfirm = (props?: {
|
||||
|
||||
return {
|
||||
openConfirm: useCallback(
|
||||
(confirm?: any, cancel?: any, customContent?: string) => {
|
||||
(confirm?: any, cancel?: any, customContent?: string | React.ReactNode) => {
|
||||
confirmCb.current = confirm;
|
||||
cancelCb.current = cancel;
|
||||
|
||||
|
@@ -58,7 +58,7 @@ export const putDatasetById = (data: DatasetUpdateBody) => PUT<void>(`/core/data
|
||||
export const delDatasetById = (id: string) => DELETE(`/core/dataset/delete?id=${id}`);
|
||||
|
||||
export const postWebsiteSync = (data: PostWebsiteSyncParams) =>
|
||||
POST(`/plusApi/core/dataset/websiteSync`, data, {
|
||||
POST(`/proApi/core/dataset/websiteSync`, data, {
|
||||
timeout: 600000
|
||||
}).catch();
|
||||
|
||||
@@ -76,7 +76,7 @@ export const getDatasetCollectionById = (id: string) =>
|
||||
export const postDatasetCollection = (data: CreateDatasetCollectionParams) =>
|
||||
POST<string>(`/core/dataset/collection/create`, data);
|
||||
export const postCreateDatasetLinkCollection = (data: LinkCreateDatasetCollectionParams) =>
|
||||
POST<{ collectionId: string }>(`/core/dataset/collection/create/link`, data);
|
||||
POST<{ collectionId: string }>(`/proApi/core/dataset/collection/create/link`, data);
|
||||
|
||||
export const putDatasetCollectionById = (data: UpdateDatasetCollectionParams) =>
|
||||
POST(`/core/dataset/collection/update`, data);
|
||||
|
@@ -27,18 +27,22 @@ export const fileCollectionCreate = ({
|
||||
form.append('bucketName', BucketNameEnum.dataset);
|
||||
form.append('file', file, encodeURIComponent(file.name));
|
||||
|
||||
return POST<string>(`/core/dataset/collection/create/file?datasetId=${data.datasetId}`, form, {
|
||||
timeout: 480000,
|
||||
onUploadProgress: (e) => {
|
||||
if (!e.total) return;
|
||||
return POST<string>(
|
||||
`/proApi/core/dataset/collection/create/emptyFile?datasetId=${data.datasetId}`,
|
||||
form,
|
||||
{
|
||||
timeout: 480000,
|
||||
onUploadProgress: (e) => {
|
||||
if (!e.total) return;
|
||||
|
||||
const percent = Math.round((e.loaded / e.total) * 100);
|
||||
percentListen && percentListen(percent);
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data; charset=utf-8'
|
||||
const percent = Math.round((e.loaded / e.total) * 100);
|
||||
percentListen && percentListen(percent);
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data; charset=utf-8'
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
};
|
||||
|
||||
export async function chunksUpload({
|
||||
|
@@ -7,8 +7,8 @@ export const getPromotionInitData = () =>
|
||||
GET<{
|
||||
invitedAmount: number;
|
||||
earningsAmount: number;
|
||||
}>('/plusApi/support/activity/promotion/getPromotionData');
|
||||
}>('/proApi/support/activity/promotion/getPromotionData');
|
||||
|
||||
/* promotion records */
|
||||
export const getPromotionRecords = (data: RequestPaging) =>
|
||||
POST<PromotionRecordType>(`/plusApi/support/activity/promotion/getPromotions`, data);
|
||||
POST<PromotionRecordType>(`/proApi/support/activity/promotion/getPromotions`, data);
|
||||
|
@@ -14,14 +14,14 @@ export const sendAuthCode = (data: {
|
||||
username: string;
|
||||
type: `${UserAuthTypeEnum}`;
|
||||
googleToken: string;
|
||||
}) => POST(`/plusApi/support/user/inform/sendAuthCode`, data);
|
||||
}) => POST(`/proApi/support/user/inform/sendAuthCode`, data);
|
||||
|
||||
export const getTokenLogin = () =>
|
||||
GET<UserType>('/support/user/account/tokenLogin', {}, { maxQuantity: 1 });
|
||||
export const oauthLogin = (params: OauthLoginProps) =>
|
||||
POST<ResLogin>('/plusApi/support/user/account/login/oauth', params);
|
||||
POST<ResLogin>('/proApi/support/user/account/login/oauth', params);
|
||||
export const postFastLogin = (params: FastLoginProps) =>
|
||||
POST<ResLogin>('/plusApi/support/user/account/login/fastLogin', params);
|
||||
POST<ResLogin>('/proApi/support/user/account/login/fastLogin', params);
|
||||
|
||||
export const postRegister = ({
|
||||
username,
|
||||
@@ -34,7 +34,7 @@ export const postRegister = ({
|
||||
password: string;
|
||||
inviterId?: string;
|
||||
}) =>
|
||||
POST<ResLogin>(`/plusApi/support/user/account/register/emailAndPhone`, {
|
||||
POST<ResLogin>(`/proApi/support/user/account/register/emailAndPhone`, {
|
||||
username,
|
||||
code,
|
||||
inviterId,
|
||||
@@ -50,7 +50,7 @@ export const postFindPassword = ({
|
||||
code: string;
|
||||
password: string;
|
||||
}) =>
|
||||
POST<ResLogin>(`/plusApi/support/user/account/password/updateByCode`, {
|
||||
POST<ResLogin>(`/proApi/support/user/account/password/updateByCode`, {
|
||||
username,
|
||||
code,
|
||||
password: hashStr(password)
|
||||
|
@@ -3,7 +3,7 @@ import type { PagingData, RequestPaging } from '@/types';
|
||||
import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type';
|
||||
|
||||
export const getInforms = (data: RequestPaging) =>
|
||||
POST<PagingData<UserInformSchema>>(`/plusApi/support/user/inform/list`, data);
|
||||
POST<PagingData<UserInformSchema>>(`/proApi/support/user/inform/list`, data);
|
||||
|
||||
export const getUnreadCount = () => GET<number>(`/plusApi/support/user/inform/countUnread`);
|
||||
export const readInform = (id: string) => GET(`/plusApi/support/user/inform/read`, { id });
|
||||
export const getUnreadCount = () => GET<number>(`/proApi/support/user/inform/countUnread`);
|
||||
export const readInform = (id: string) => GET(`/proApi/support/user/inform/read`, { id });
|
||||
|
@@ -16,29 +16,29 @@ import {
|
||||
|
||||
/* --------------- team ---------------- */
|
||||
export const getTeamList = (status: `${TeamMemberSchema['status']}`) =>
|
||||
GET<TeamItemType[]>(`/plusApi/support/user/team/list`, { status });
|
||||
GET<TeamItemType[]>(`/proApi/support/user/team/list`, { status });
|
||||
export const postCreateTeam = (data: CreateTeamProps) =>
|
||||
POST<string>(`/plusApi/support/user/team/create`, data);
|
||||
POST<string>(`/proApi/support/user/team/create`, data);
|
||||
export const putUpdateTeam = (data: UpdateTeamProps) =>
|
||||
PUT(`/plusApi/support/user/team/update`, data);
|
||||
PUT(`/proApi/support/user/team/update`, data);
|
||||
export const putSwitchTeam = (teamId: string) =>
|
||||
PUT<string>(`/plusApi/support/user/team/switch`, { teamId });
|
||||
PUT<string>(`/proApi/support/user/team/switch`, { teamId });
|
||||
|
||||
/* --------------- team member ---------------- */
|
||||
export const getTeamMembers = (teamId: string) =>
|
||||
GET<TeamMemberItemType[]>(`/plusApi/support/user/team/member/list`, { teamId });
|
||||
GET<TeamMemberItemType[]>(`/proApi/support/user/team/member/list`, { teamId });
|
||||
export const postInviteTeamMember = (data: InviteMemberProps) =>
|
||||
POST<InviteMemberResponse>(`/plusApi/support/user/team/member/invite`, data);
|
||||
POST<InviteMemberResponse>(`/proApi/support/user/team/member/invite`, data);
|
||||
export const putUpdateMember = (data: UpdateTeamMemberProps) =>
|
||||
PUT(`/plusApi/support/user/team/member/update`, data);
|
||||
PUT(`/proApi/support/user/team/member/update`, data);
|
||||
export const putUpdateMemberName = (name: string) =>
|
||||
PUT(`/plusApi/support/user/team/member/updateName`, { name });
|
||||
PUT(`/proApi/support/user/team/member/updateName`, { name });
|
||||
export const delRemoveMember = (props: DelMemberProps) =>
|
||||
DELETE(`/plusApi/support/user/team/member/delete`, props);
|
||||
DELETE(`/proApi/support/user/team/member/delete`, props);
|
||||
export const updateInviteResult = (data: UpdateInviteProps) =>
|
||||
PUT('/plusApi/support/user/team/member/updateInvite', data);
|
||||
PUT('/proApi/support/user/team/member/updateInvite', data);
|
||||
export const delLeaveTeam = (teamId: string) =>
|
||||
DELETE('/plusApi/support/user/team/member/leave', { teamId });
|
||||
DELETE('/proApi/support/user/team/member/leave', { teamId });
|
||||
|
||||
/* team limit */
|
||||
export const checkTeamExportDatasetLimit = (datasetId: string) =>
|
||||
|
@@ -4,7 +4,7 @@ import type { PagingData, RequestPaging } from '@/types';
|
||||
import type { BillItemType } from '@fastgpt/global/support/wallet/bill/type';
|
||||
|
||||
export const getUserBills = (data: RequestPaging) =>
|
||||
POST<PagingData<BillItemType>>(`/plusApi/support/wallet/bill/getBill`, data);
|
||||
POST<PagingData<BillItemType>>(`/proApi/support/wallet/bill/getBill`, data);
|
||||
|
||||
export const postCreateTrainingBill = (data: CreateTrainingBillProps) =>
|
||||
POST<string>(`/support/wallet/bill/createTrainingBill`, data);
|
||||
|
@@ -1,15 +1,15 @@
|
||||
import { GET } from '@/web/common/api/request';
|
||||
import type { PaySchema } from '@fastgpt/global/support/wallet/pay/type.d';
|
||||
export const getPayOrders = () => GET<PaySchema[]>(`/plusApi/support/wallet/pay/getPayOrders`);
|
||||
export const getPayOrders = () => GET<PaySchema[]>(`/proApi/support/wallet/pay/getPayOrders`);
|
||||
|
||||
export const getPayCode = (amount: number) =>
|
||||
GET<{
|
||||
codeUrl: string;
|
||||
payId: string;
|
||||
}>(`/plusApi/support/wallet/pay/getPayCode`, { amount });
|
||||
}>(`/proApi/support/wallet/pay/getPayCode`, { amount });
|
||||
|
||||
export const checkPayResult = (payId: string) =>
|
||||
GET<string>(`/plusApi/support/wallet/pay/checkPayResult`, { payId }).then((data) => {
|
||||
GET<string>(`/proApi/support/wallet/pay/checkPayResult`, { payId }).then((data) => {
|
||||
try {
|
||||
GET('/common/system/unlockTask');
|
||||
} catch (error) {}
|
||||
|
@@ -10,4 +10,4 @@ export const getTeamDatasetValidSub = () =>
|
||||
}>(`/support/wallet/sub/getDatasetSub`);
|
||||
|
||||
export const postExpandTeamDatasetSub = (data: SubDatasetSizeParams) =>
|
||||
POST('/plusApi/support/wallet/sub/datasetSize/expand', data);
|
||||
POST('/proApi/support/wallet/sub/datasetSize/expand', data);
|
||||
|
Reference in New Issue
Block a user