fix: invite link (#4229)

* fix: invite link

* feat: create invite link and copy it directly
This commit is contained in:
Finley Ge
2025-03-19 19:59:55 +08:00
committed by archer
parent 077350e651
commit 73451dbc64
6 changed files with 70 additions and 34 deletions

View File

@@ -32,3 +32,32 @@ export async function getRootUser(): Promise<parseHeaderCertRet> {
tmbId: tmb?._id
};
}
export async function getUser(username: string): Promise<parseHeaderCertRet> {
const user = await MongoUser.create({
username,
password: '123456'
});
const team = await MongoTeam.create({
name: 'test team',
ownerId: user._id
});
const tmb = await MongoTeamMember.create({
teamId: team._id,
userId: user._id,
status: 'active'
});
return {
userId: user._id,
apikey: '',
appId: '',
authType: AuthUserTypeEnum.token,
isRoot: false,
sourceName: undefined,
teamId: tmb?.teamId,
tmbId: tmb?._id
};
}