fix: price page init data;perf: usage code;fix: reasoning tokens;fix: workflow basic node cannot upgrade (#3816)
* fix: img read * fix: price page init data * perf: ai model avatar * perf: refresh in change team * perf: null checker * perf: usage code * fix: reasoning tokens * fix: workflow basic node cannot upgrade * perf: model refresh * perf: icon refresh
This commit is contained in:
@@ -44,12 +44,22 @@ async function handler(
|
||||
defaultModels: global.systemDefaultModel
|
||||
};
|
||||
} catch (error) {
|
||||
const referer = req.headers.referer;
|
||||
if (referer?.includes('/price')) {
|
||||
return {
|
||||
feConfigs: global.feConfigs,
|
||||
subPlans: global.subPlans,
|
||||
activeModelList
|
||||
};
|
||||
}
|
||||
|
||||
const unAuthBufferId = global.systemInitBufferId ? `unAuth_${global.systemInitBufferId}` : '';
|
||||
if (bufferId && unAuthBufferId === bufferId) {
|
||||
return {
|
||||
bufferId: unAuthBufferId
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
bufferId: unAuthBufferId,
|
||||
feConfigs: global.feConfigs
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
SseResponseEventEnum
|
||||
} from '@fastgpt/global/core/workflow/runtime/constants';
|
||||
import { responseWrite } from '@fastgpt/service/common/response';
|
||||
import { pushChatUsage } from '@/service/support/wallet/usage/push';
|
||||
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
|
||||
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
|
||||
import type { AIChatItemType, UserChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
||||
@@ -244,7 +244,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
}
|
||||
|
||||
pushChatUsage({
|
||||
createChatUsage({
|
||||
appName,
|
||||
appId,
|
||||
teamId,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { pushChatUsage } from '@/service/support/wallet/usage/push';
|
||||
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
|
||||
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
|
||||
import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
||||
import { dispatchWorkFlow } from '@fastgpt/service/core/workflow/dispatch';
|
||||
@@ -66,8 +66,8 @@ async function handler(
|
||||
maxRunTimes: WORKFLOW_MAX_RUN_TIMES
|
||||
});
|
||||
|
||||
pushChatUsage({
|
||||
appName: '工作流Debug',
|
||||
createChatUsage({
|
||||
appName: `${app.name}-Debug`,
|
||||
appId,
|
||||
teamId,
|
||||
tmbId,
|
||||
|
||||
@@ -20,7 +20,7 @@ import { GPTMessages2Chats, chatValue2RuntimePrompt } from '@fastgpt/global/core
|
||||
import { getChatItems } from '@fastgpt/service/core/chat/controller';
|
||||
import { saveChat, updateInteractiveChat } from '@fastgpt/service/core/chat/saveChat';
|
||||
import { responseWrite } from '@fastgpt/service/common/response';
|
||||
import { pushChatUsage } from '@/service/support/wallet/usage/push';
|
||||
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
|
||||
import { authOutLinkChatStart } from '@/service/support/permission/auth/outLink';
|
||||
import { pushResult2Remote, addOutLinkUsage } from '@fastgpt/service/support/outLink/tools';
|
||||
import requestIp from 'request-ip';
|
||||
@@ -423,7 +423,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
// add record
|
||||
const { totalPoints } = pushChatUsage({
|
||||
const { totalPoints } = createChatUsage({
|
||||
appName: app.name,
|
||||
appId: app._id,
|
||||
teamId,
|
||||
|
||||
Reference in New Issue
Block a user