This commit is contained in:
Archer
2023-10-22 23:54:04 +08:00
committed by GitHub
parent 3091a90df6
commit a3534407bf
365 changed files with 7266 additions and 6055 deletions

View File

@@ -1,27 +0,0 @@
import { GET, POST, PUT, DELETE } from '@/web/common/api/request';
import type { CreateTrainingBillType } from '@/global/common/api/billReq.d';
import type { PaySchema } from '@/types/mongoSchema';
import type { PagingData, RequestPaging } from '@/types';
import { UserBillType } from '@/types/user';
export const getUserBills = (data: RequestPaging) =>
POST<PagingData<UserBillType>>(`/user/getBill`, data);
export const postCreateTrainingBill = (data: CreateTrainingBillType) =>
POST<string>(`/common/bill/createTrainingBill`, data);
export const getPayOrders = () => GET<PaySchema[]>(`/user/getPayOrders`);
export const getPayCode = (amount: number) =>
GET<{
codeUrl: string;
payId: string;
}>(`/plusApi/support/user/pay/getPayCode`, { amount });
export const checkPayResult = (payId: string) =>
GET<number>(`/plusApi/support/user/pay/checkPayResult`, { payId }).then(() => {
try {
GET('/user/account/paySuccess');
} catch (error) {}
return 'success';
});

View File

@@ -1,9 +1,9 @@
import { sseResponseEventEnum, TaskResponseKeyEnum } from '@/constants/chat';
import { getErrText } from '@/utils/tools';
import { getErrText } from '@fastgpt/global/common/error/utils';
import { parseStreamChunk, SSEParseData } from '@/utils/sse';
import type { ChatHistoryItemResType } from '@/types/chat';
import { StartChatFnProps } from '@/components/ChatBox';
import { getToken } from '@/utils/user';
import { getToken } from '@/web/support/user/auth';
type StreamFetchProps = {
url?: string;

View File

@@ -1,6 +0,0 @@
import { GET, POST, PUT, DELETE } from './request';
import type { FetchResultItem } from '@/global/common/api/pluginRes.d';
export const postFetchUrls = (urlList: string[]) =>
POST<FetchResultItem[]>(`/plugins/urlFetch`, { urlList });

View File

@@ -4,8 +4,8 @@ import axios, {
AxiosResponse,
AxiosProgressEvent
} from 'axios';
import { clearToken, getToken } from '@/utils/user';
import { TOKEN_ERROR_CODE } from '@fastgpt/common/constant/errorCode';
import { clearToken, getToken } from '@/web/support/user/auth';
import { TOKEN_ERROR_CODE } from '@fastgpt/global/common/error/errorCode';
interface ConfigType {
headers?: { [key: string]: string };

View File

@@ -1,22 +0,0 @@
import { GET, POST, PUT } from './request';
import type { InitDateResponse } from '@/global/common/api/systemRes';
import { AxiosProgressEvent } from 'axios';
export const getSystemInitData = () => GET<InitDateResponse>('/system/getInitData');
export const postUploadImg = (base64Img: string) =>
POST<string>('/system/file/uploadImage', { base64Img });
export const postUploadFiles = (
data: FormData,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void
) =>
POST<string[]>('/system/file/upload', data, {
timeout: 60000,
onUploadProgress,
headers: {
'Content-Type': 'multipart/form-data; charset=utf-8'
}
});
export const getFileViewUrl = (fileId: string) => GET<string>('/system/file/readUrl', { fileId });