diff --git a/packages/global/support/user/team/type.d.ts b/packages/global/support/user/team/type.d.ts index d618b313098..9c7dc12b42b 100644 --- a/packages/global/support/user/team/type.d.ts +++ b/packages/global/support/user/team/type.d.ts @@ -59,7 +59,7 @@ export type TeamTmbItemType = { teamName: string; memberName: string; avatar: string; - balance: number; + balance?: number; tmbId: string; teamDomain: string; defaultTeam: boolean; diff --git a/packages/service/support/user/team/controller.ts b/packages/service/support/user/team/controller.ts index d4199be0651..451e02f5b68 100644 --- a/packages/service/support/user/team/controller.ts +++ b/packages/service/support/user/team/controller.ts @@ -80,13 +80,11 @@ export async function createDefaultTeam({ userId, teamName = 'My Team', avatar = '/icon/logo.svg', - balance, session }: { userId: string; teamName?: string; avatar?: string; - balance?: number; session: ClientSession; }) { // auth default team @@ -103,7 +101,6 @@ export async function createDefaultTeam({ ownerId: userId, name: teamName, avatar, - balance, createTime: new Date() } ], @@ -140,11 +137,6 @@ export async function createDefaultTeam({ return tmb; } else { console.log('default team exist', userId); - await MongoTeam.findByIdAndUpdate(tmb.teamId, { - $set: { - ...(balance !== undefined && { balance }) - } - }); } } diff --git a/packages/service/support/user/team/teamSchema.ts b/packages/service/support/user/team/teamSchema.ts index a418d0c342c..86a291cddd4 100644 --- a/packages/service/support/user/team/teamSchema.ts +++ b/packages/service/support/user/team/teamSchema.ts @@ -21,10 +21,7 @@ const TeamSchema = new Schema({ type: Date, default: () => Date.now() }, - balance: { - type: Number, - default: 0 - }, + balance: Number, teamDomain: { type: String }, diff --git a/projects/app/src/pages/account/info/index.tsx b/projects/app/src/pages/account/info/index.tsx index 9e98726fdb8..48c71cc3127 100644 --- a/projects/app/src/pages/account/info/index.tsx +++ b/projects/app/src/pages/account/info/index.tsx @@ -9,8 +9,7 @@ import { Link, Progress, Grid, - BoxProps, - FlexProps + BoxProps } from '@chakra-ui/react'; import { useForm } from 'react-hook-form'; import { UserUpdateParams } from '@/types/user'; diff --git a/projects/app/src/pages/account/team/components/OrgManage/OrgInfoModal.tsx b/projects/app/src/pages/account/team/components/OrgManage/OrgInfoModal.tsx index bd7b0c7e5ac..c2e49b36820 100644 --- a/projects/app/src/pages/account/team/components/OrgManage/OrgInfoModal.tsx +++ b/projects/app/src/pages/account/team/components/OrgManage/OrgInfoModal.tsx @@ -159,4 +159,4 @@ function OrgInfoModal({ ); } -export default dynamic(() => Promise.resolve(OrgInfoModal), { ssr: false }); +export default OrgInfoModal; diff --git a/projects/app/src/pages/account/team/components/OrgManage/OrgMemberManageModal.tsx b/projects/app/src/pages/account/team/components/OrgManage/OrgMemberManageModal.tsx index 7ef0a3787a2..3e2f2afe0f7 100644 --- a/projects/app/src/pages/account/team/components/OrgManage/OrgMemberManageModal.tsx +++ b/projects/app/src/pages/account/team/components/OrgManage/OrgMemberManageModal.tsx @@ -194,4 +194,4 @@ function OrgMemberManageModal({ ); } -export default dynamic(() => Promise.resolve(OrgMemberManageModal), { ssr: false }); +export default OrgMemberManageModal; diff --git a/projects/app/src/pages/account/team/components/OrgManage/OrgMoveModal.tsx b/projects/app/src/pages/account/team/components/OrgManage/OrgMoveModal.tsx index df4dbf0a3a3..080c4eedb38 100644 --- a/projects/app/src/pages/account/team/components/OrgManage/OrgMoveModal.tsx +++ b/projects/app/src/pages/account/team/components/OrgManage/OrgMoveModal.tsx @@ -71,4 +71,4 @@ function OrgMoveModal({ ); } -export default dynamic(() => Promise.resolve(OrgMoveModal), { ssr: false }); +export default OrgMoveModal; diff --git a/projects/app/src/pages/account/team/components/OrgManage/index.tsx b/projects/app/src/pages/account/team/components/OrgManage/index.tsx index 49f474dc755..35612d8f100 100644 --- a/projects/app/src/pages/account/team/components/OrgManage/index.tsx +++ b/projects/app/src/pages/account/team/components/OrgManage/index.tsx @@ -30,15 +30,17 @@ import { TeamContext } from '../context'; import { getOrgList } from '@/web/support/user/team/org/api'; import IconButton from './IconButton'; -import OrgInfoModal, { defaultOrgForm, OrgFormType } from './OrgInfoModal'; -import OrgMemberManageModal from './OrgMemberManageModal'; +import type { defaultOrgForm, OrgFormType } from './OrgInfoModal'; -import OrgMoveModal from './OrgMoveModal'; import dynamic from 'next/dynamic'; import MyBox from '@fastgpt/web/components/common/MyBox'; import Path from '@/components/common/folder/Path'; import { ParentTreePathItemType } from '@fastgpt/global/common/parentFolder/type'; +const OrgInfoModal = dynamic(() => import('./OrgInfoModal')); +const OrgMemberManageModal = dynamic(() => import('./OrgMemberManageModal')); +const OrgMoveModal = dynamic(() => import('./OrgMoveModal')); + function ActionButton({ icon, text, @@ -68,7 +70,7 @@ function ActionButton({ ); } -function MemberTable() { +function OrgTable() { const { t } = useTranslation(); const { userInfo, isTeamAdmin } = useUserStore(); @@ -340,4 +342,4 @@ function MemberTable() { ); } -export default dynamic(() => Promise.resolve(MemberTable), { ssr: false }); +export default OrgTable; diff --git a/projects/app/src/pages/account/team/index.tsx b/projects/app/src/pages/account/team/index.tsx index f4e9a394998..56af9f3cd53 100644 --- a/projects/app/src/pages/account/team/index.tsx +++ b/projects/app/src/pages/account/team/index.tsx @@ -22,13 +22,12 @@ import dynamic from 'next/dynamic'; import TeamTagModal from '@/components/support/user/team/TeamTagModal'; import MemberTable from './components/MemberTable'; -import OrgManage from './components/OrgManage/index'; - const InviteModal = dynamic(() => import('./components/InviteModal')); const PermissionManage = dynamic(() => import('./components/PermissionManage/index')); const GroupManage = dynamic(() => import('./components/GroupManage/index')); const GroupInfoModal = dynamic(() => import('./components/GroupManage/GroupInfoModal')); const ManageGroupMemberModal = dynamic(() => import('./components/GroupManage/GroupManageMember')); +const OrgManage = dynamic(() => import('./components/OrgManage/index')); export enum TeamTabEnum { member = 'member', diff --git a/projects/app/src/service/mongo.ts b/projects/app/src/service/mongo.ts index e3c3efea66b..3d043cdb14d 100644 --- a/projects/app/src/service/mongo.ts +++ b/projects/app/src/service/mongo.ts @@ -42,7 +42,7 @@ export async function initRootUser(retry = 3): Promise { rootId = _id; } // init root team - await createDefaultTeam({ userId: rootId, balance: 9999 * PRICE_SCALE, session }); + await createDefaultTeam({ userId: rootId, session }); }); console.log(`root user init:`, {