mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 03:48:24 +00:00
Extraction schema (#398)
This commit is contained in:
@@ -16,10 +16,10 @@ export const getPayCode = (amount: number) =>
|
||||
GET<{
|
||||
codeUrl: string;
|
||||
payId: string;
|
||||
}>(`/plusApi/user/pay/getPayCode`, { amount });
|
||||
}>(`/plusApi/support/user/pay/getPayCode`, { amount });
|
||||
|
||||
export const checkPayResult = (payId: string) =>
|
||||
GET<number>(`/plusApi/user/pay/checkPayResult`, { payId }).then(() => {
|
||||
GET<number>(`/plusApi/support/user/pay/checkPayResult`, { payId }).then(() => {
|
||||
try {
|
||||
GET('/user/account/paySuccess');
|
||||
} catch (error) {}
|
||||
|
@@ -5,7 +5,7 @@ import axios, {
|
||||
AxiosProgressEvent
|
||||
} from 'axios';
|
||||
import { clearToken, getToken } from '@/utils/user';
|
||||
import { TOKEN_ERROR_CODE } from '@/service/errorCode';
|
||||
import { TOKEN_ERROR_CODE } from '@fastgpt/common/constant/errorCode';
|
||||
|
||||
interface ConfigType {
|
||||
headers?: { [key: string]: string };
|
||||
|
@@ -12,6 +12,7 @@ export const postUploadFiles = (
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void
|
||||
) =>
|
||||
POST<string[]>('/system/file/upload', data, {
|
||||
timeout: 60000,
|
||||
onUploadProgress,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data; charset=utf-8'
|
||||
|
@@ -6,9 +6,8 @@ import {
|
||||
import type { InitDateResponse } from '@/global/common/api/systemRes';
|
||||
import { getSystemInitData } from '@/web/common/api/system';
|
||||
import { delay } from '@/utils/tools';
|
||||
import { FeConfigsType } from '@/types';
|
||||
import type { FeConfigsType } from '@fastgpt/common/type/index.d';
|
||||
|
||||
export let systemVersion = '0.0.0';
|
||||
export let chatModelList: ChatModelItemType[] = [];
|
||||
export let qaModel: QAModelItemType = {
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
@@ -18,6 +17,8 @@ export let qaModel: QAModelItemType = {
|
||||
};
|
||||
export let vectorModelList: VectorModelItemType[] = [];
|
||||
export let feConfigs: FeConfigsType = {};
|
||||
export let priceMd = '';
|
||||
export let systemVersion = '0.0.0';
|
||||
|
||||
let retryTimes = 3;
|
||||
|
||||
@@ -29,6 +30,7 @@ export const clientInitData = async (): Promise<InitDateResponse> => {
|
||||
qaModel = res.qaModel;
|
||||
vectorModelList = res.vectorModels;
|
||||
feConfigs = res.feConfigs;
|
||||
priceMd = res.priceMd;
|
||||
systemVersion = res.systemVersion;
|
||||
|
||||
return res;
|
||||
|
@@ -12,7 +12,7 @@ import type {
|
||||
GetDatasetDataListProps
|
||||
} from '@/global/core/api/datasetReq.d';
|
||||
import type { SearchTestResponseType, PushDataResponse } from '@/global/core/api/datasetRes.d';
|
||||
import { KbTypeEnum } from '@/constants/dataset';
|
||||
import { DatasetTypeEnum } from '@fastgpt/core/dataset/constant';
|
||||
import type { DatasetFileItemType } from '@/types/core/dataset/file';
|
||||
import type { GSFileInfoType } from '@/types/common/file';
|
||||
import type { QuoteItemType } from '@/types/chat';
|
||||
@@ -21,7 +21,7 @@ import download from 'downloadjs';
|
||||
import type { DatasetDataItemType } from '@/types/core/dataset/data';
|
||||
|
||||
/* ======================== dataset ======================= */
|
||||
export const getDatasets = (data: { parentId?: string; type?: `${KbTypeEnum}` }) =>
|
||||
export const getDatasets = (data: { parentId?: string; type?: `${DatasetTypeEnum}` }) =>
|
||||
GET<DatasetsItemType[]>(`/core/dataset/list`, data);
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { GET, POST, DELETE } from '@/web/common/api/request';
|
||||
import type { EditApiKeyProps, GetApiKeyProps } from '@/global/support/api/openapiReq.d';
|
||||
import type { OpenApiSchema } from '@/types/support/openapi';
|
||||
import type { OpenApiSchema } from '@fastgpt/support/openapi/type.d';
|
||||
|
||||
/**
|
||||
* crete a api key
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { GET, POST, DELETE } from '@/web/common/api/request';
|
||||
import type { InitShareChatResponse } from '@/global/support/api/outLinkRes.d';
|
||||
import type { OutLinkEditType } from '@/types/support/outLink';
|
||||
import type { OutLinkSchema } from '@/types/support/outLink';
|
||||
import type { OutLinkEditType, OutLinkSchema } from '@fastgpt/support/outLink/type.d';
|
||||
|
||||
/**
|
||||
* 初始化分享聊天
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { GET, POST, PUT } from '@/web/common/api/request';
|
||||
import { createHashPassword } from '@/utils/tools';
|
||||
import { hashStr } from '@fastgpt/common/tools/str';
|
||||
import type { ResLogin, PromotionRecordType } from '@/global/support/api/userRes.d';
|
||||
import { UserAuthTypeEnum } from '@/constants/common';
|
||||
import { UserType, UserUpdateParams } from '@/types/user';
|
||||
@@ -11,7 +11,7 @@ export const sendAuthCode = (data: {
|
||||
username: string;
|
||||
type: `${UserAuthTypeEnum}`;
|
||||
googleToken: string;
|
||||
}) => POST(`/plusApi/user/inform/sendAuthCode`, data);
|
||||
}) => POST(`/plusApi/support/user/inform/sendAuthCode`, data);
|
||||
|
||||
export const getTokenLogin = () => GET<UserType>('/user/account/tokenLogin');
|
||||
export const oauthLogin = (params: {
|
||||
@@ -19,7 +19,7 @@ export const oauthLogin = (params: {
|
||||
code: string;
|
||||
callbackUrl: string;
|
||||
inviterId?: string;
|
||||
}) => POST<ResLogin>('/plusApi/user/account/login/oauth', params);
|
||||
}) => POST<ResLogin>('/plusApi/support/user/account/login/oauth', params);
|
||||
|
||||
export const postRegister = ({
|
||||
username,
|
||||
@@ -32,11 +32,11 @@ export const postRegister = ({
|
||||
password: string;
|
||||
inviterId?: string;
|
||||
}) =>
|
||||
POST<ResLogin>(`/plusApi/user/account/register/emailAndPhone`, {
|
||||
POST<ResLogin>(`/plusApi/support/user/account/register/emailAndPhone`, {
|
||||
username,
|
||||
code,
|
||||
inviterId,
|
||||
password: createHashPassword(password)
|
||||
password: hashStr(password)
|
||||
});
|
||||
|
||||
export const postFindPassword = ({
|
||||
@@ -48,22 +48,22 @@ export const postFindPassword = ({
|
||||
code: string;
|
||||
password: string;
|
||||
}) =>
|
||||
POST<ResLogin>(`/plusApi/user/account/password/updateByCode`, {
|
||||
POST<ResLogin>(`/plusApi/support/user/account/password/updateByCode`, {
|
||||
username,
|
||||
code,
|
||||
password: createHashPassword(password)
|
||||
password: hashStr(password)
|
||||
});
|
||||
|
||||
export const updatePasswordByOld = ({ oldPsw, newPsw }: { oldPsw: string; newPsw: string }) =>
|
||||
POST('/user/account/updatePasswordByOld', {
|
||||
oldPsw: createHashPassword(oldPsw),
|
||||
newPsw: createHashPassword(newPsw)
|
||||
oldPsw: hashStr(oldPsw),
|
||||
newPsw: hashStr(newPsw)
|
||||
});
|
||||
|
||||
export const postLogin = ({ username, password }: { username: string; password: string }) =>
|
||||
POST<ResLogin>('/user/account/loginByPassword', {
|
||||
username,
|
||||
password: createHashPassword(password)
|
||||
password: hashStr(password)
|
||||
});
|
||||
|
||||
export const loginOut = () => GET('/user/account/loginout');
|
||||
|
Reference in New Issue
Block a user