4.6.7-alpha commit (#743)

Co-authored-by: Archer <545436317@qq.com>
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-19 11:17:28 +08:00
committed by GitHub
parent 8ee7407c4c
commit c031e6dcc9
324 changed files with 8509 additions and 4757 deletions

View File

@@ -1,6 +1,6 @@
import { UserType } from '@fastgpt/global/support/user/type';
import { MongoUser } from './schema';
import { getTeamInfoByTmbId, getUserDefaultTeam } from './team/controller';
import { getTmbInfoByTmbId, getUserDefaultTeam } from './team/controller';
import { ERROR_ENUM } from '@fastgpt/global/common/error/errorCode';
import { UserErrEnum } from '@fastgpt/global/common/error/code/user';
@@ -21,16 +21,16 @@ export async function getUserDetail({
tmbId?: string;
userId?: string;
}): Promise<UserType> {
const team = await (async () => {
const tmb = await (async () => {
if (tmbId) {
return getTeamInfoByTmbId({ tmbId });
return getTmbInfoByTmbId({ tmbId });
}
if (userId) {
return getUserDefaultTeam({ userId });
}
return Promise.reject(ERROR_ENUM.unAuthorization);
})();
const user = await MongoUser.findById(team.userId);
const user = await MongoUser.findById(tmb.userId);
if (!user) {
return Promise.reject(ERROR_ENUM.unAuthorization);
@@ -44,7 +44,7 @@ export async function getUserDetail({
timezone: user.timezone,
promotionRate: user.promotionRate,
openaiAccount: user.openaiAccount,
team
team: tmb
};
}