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:
@@ -284,7 +284,7 @@ const MyInfo = ({ onOpenContact }: { onOpenContact: () => void }) => {
|
||||
<Flex mt={6} alignItems={'center'}>
|
||||
<Box {...labelStyles}>{t('account_info:user_team_team_name')}: </Box>
|
||||
<Flex flex={'1 0 0'} w={0} align={'center'}>
|
||||
<TeamSelector height={'28px'} w={'100%'} showManage afterSwitchTeam={initUserInfo} />
|
||||
<TeamSelector height={'28px'} w={'100%'} showManage onChange={initUserInfo} />
|
||||
</Flex>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
@@ -88,7 +88,7 @@ const Team = () => {
|
||||
</Box>
|
||||
</Flex>
|
||||
<Flex align={'center'} ml={6}>
|
||||
<TeamSelector height={'28px'} afterSwitchTeam={refetchMembers} />
|
||||
<TeamSelector height={'28px'} onChange={refetchMembers} />
|
||||
</Flex>
|
||||
{userInfo?.team?.role === TeamMemberRoleEnum.owner && (
|
||||
<Flex align={'center'} justify={'center'} ml={2} p={'0.44rem'}>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -67,9 +67,7 @@ const Login = ({ ChineseRedirectUrl }: { ChineseRedirectUrl: string }) => {
|
||||
// 检查是否是当前的 route
|
||||
const navigateTo =
|
||||
decodeLastRoute && !decodeLastRoute.includes('/login') ? decodeLastRoute : '/app/list';
|
||||
setTimeout(() => {
|
||||
router.push(navigateTo);
|
||||
}, 300);
|
||||
router.push(navigateTo);
|
||||
},
|
||||
[setUserInfo, lastRoute, router]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user