mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
4.6.4 (#588)
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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) {
|
||||
|
@@ -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',
|
||||
|
@@ -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 {
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user