perf: notify account (#3515)
This commit is contained in:
2
packages/global/support/user/team/type.d.ts
vendored
2
packages/global/support/user/team/type.d.ts
vendored
@@ -59,7 +59,7 @@ export type TeamTmbItemType = {
|
||||
teamName: string;
|
||||
memberName: string;
|
||||
avatar: string;
|
||||
balance: number;
|
||||
balance?: number;
|
||||
tmbId: string;
|
||||
teamDomain: string;
|
||||
defaultTeam: boolean;
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,7 @@ const TeamSchema = new Schema({
|
||||
type: Date,
|
||||
default: () => Date.now()
|
||||
},
|
||||
balance: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
balance: Number,
|
||||
teamDomain: {
|
||||
type: String
|
||||
},
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -159,4 +159,4 @@ function OrgInfoModal({
|
||||
);
|
||||
}
|
||||
|
||||
export default dynamic(() => Promise.resolve(OrgInfoModal), { ssr: false });
|
||||
export default OrgInfoModal;
|
||||
|
||||
@@ -194,4 +194,4 @@ function OrgMemberManageModal({
|
||||
);
|
||||
}
|
||||
|
||||
export default dynamic(() => Promise.resolve(OrgMemberManageModal), { ssr: false });
|
||||
export default OrgMemberManageModal;
|
||||
|
||||
@@ -71,4 +71,4 @@ function OrgMoveModal({
|
||||
);
|
||||
}
|
||||
|
||||
export default dynamic(() => Promise.resolve(OrgMoveModal), { ssr: false });
|
||||
export default OrgMoveModal;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -42,7 +42,7 @@ export async function initRootUser(retry = 3): Promise<any> {
|
||||
rootId = _id;
|
||||
}
|
||||
// init root team
|
||||
await createDefaultTeam({ userId: rootId, balance: 9999 * PRICE_SCALE, session });
|
||||
await createDefaultTeam({ userId: rootId, session });
|
||||
});
|
||||
|
||||
console.log(`root user init:`, {
|
||||
|
||||
Reference in New Issue
Block a user