This commit is contained in:
Archer
2023-12-11 15:12:14 +08:00
committed by GitHub
parent 84cf6b5658
commit d2d7eac9e0
105 changed files with 1091 additions and 801 deletions

View File

@@ -99,10 +99,14 @@ function responseError(err: any) {
// 有报错响应
if (err?.code in TOKEN_ERROR_CODE) {
clearToken();
window.location.replace(
`/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}`
);
return Promise.reject({ message: 'token过期重新登录' });
if (window.location.pathname !== '/chat/share') {
window.location.replace(
`/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}`
);
}
return Promise.reject({ message: '无权操作' });
}
if (err?.response?.data) {
return Promise.reject(err?.response?.data);

View File

@@ -13,6 +13,7 @@ import type {
DeleteChatItemProps,
UpdateHistoryProps
} from '@/global/core/chat/api.d';
import { UpdateChatFeedbackProps } from '@fastgpt/global/core/chat/api';
/**
* 获取初始化聊天内容
@@ -49,8 +50,8 @@ export const delChatRecordById = (data: DeleteChatItemProps) =>
*/
export const putChatHistory = (data: UpdateHistoryProps) => PUT('/core/chat/updateHistory', data);
export const userUpdateChatFeedback = (data: { chatItemId: string; userFeedback?: string }) =>
POST('/core/chat/feedback/userUpdate', data);
export const updateChatUserFeedback = (data: UpdateChatFeedbackProps) =>
POST('/core/chat/feedback/updateUserFeedback', data);
export const adminUpdateChatFeedback = (data: AdminUpdateFeedbackParams) =>
export const updateChatAdminFeedback = (data: AdminUpdateFeedbackParams) =>
POST('/core/chat/feedback/adminUpdate', data);

View File

@@ -31,6 +31,12 @@ export async function chunksUpload({
});
}
// add chunk index
chunks = chunks.map((chunk, i) => ({
...chunk,
chunkIndex: i
}));
let successInsert = 0;
let retryTimes = 10;
for (let i = 0; i < chunks.length; i += rate) {

View File

@@ -49,7 +49,7 @@ export const FlowValueTypeMap = {
example: `{
obj: System | Human | AI;
value: string;
}`
}[]`
},
[ModuleDataTypeEnum.datasetQuote]: {
label: 'core.module.valueType.datasetQuote',
@@ -62,7 +62,7 @@ export const FlowValueTypeMap = {
sourceId?: string;
q: string;
a: string
}`
}[]`
},
[ModuleDataTypeEnum.any]: {
label: 'core.module.valueType.any',

View File

@@ -1,7 +1,7 @@
import { GET, POST, PUT } from '@/web/common/api/request';
import { hashStr } from '@fastgpt/global/common/string/tools';
import type { ResLogin } from '@/global/support/api/userRes.d';
import { UserAuthTypeEnum } from '@/constants/common';
import { UserAuthTypeEnum } from '@fastgpt/global/support/user/constant';
import { UserUpdateParams } from '@/types/user';
import { UserType } from '@fastgpt/global/support/user/type.d';
import type {

View File

@@ -1,6 +1,6 @@
import { useState, useMemo, useCallback } from 'react';
import { sendAuthCode } from '@/web/support/user/api';
import { UserAuthTypeEnum } from '@/constants/common';
import { UserAuthTypeEnum } from '@fastgpt/global/support/user/constant';
import { useToast } from '@/web/common/hooks/useToast';
import { feConfigs } from '@/web/common/system/staticData';
import { getErrText } from '@fastgpt/global/common/error/utils';