perf: logs, auth root as super admin, etc (#2615)
* chore: usePagination hook type * feat: chat log show outlinkuid or tmb avatar and name * fix: ts error for pagination * feat: auth root
This commit is contained in:
@@ -13,7 +13,7 @@ import { readFromSecondary } from '@fastgpt/service/common/mongo/utils';
|
||||
|
||||
async function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
_res: NextApiResponse
|
||||
): Promise<PagingData<AppLogsListItemType>> {
|
||||
const {
|
||||
pageNum = 1,
|
||||
@@ -131,7 +131,9 @@ async function handler(
|
||||
userGoodFeedbackCount: 1,
|
||||
userBadFeedbackCount: 1,
|
||||
customFeedbacksCount: 1,
|
||||
markCount: 1
|
||||
markCount: 1,
|
||||
outLinkUid: 1,
|
||||
tmbId: 1
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -6,7 +6,6 @@ import { connectToDatabase } from '@/service/mongo';
|
||||
import { getUserDetail } from '@fastgpt/service/support/user/controller';
|
||||
import type { PostLoginProps } from '@fastgpt/global/support/user/api.d';
|
||||
import { UserStatusEnum } from '@fastgpt/global/support/user/constant';
|
||||
import { checkTeamAiPointsAndLock } from '@/service/events/utils';
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
try {
|
||||
@@ -50,7 +49,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
lastLoginTmbId: userDetail.team.tmbId
|
||||
});
|
||||
|
||||
const token = createJWT(userDetail);
|
||||
const token = createJWT({
|
||||
...userDetail,
|
||||
isRoot: username === 'root'
|
||||
});
|
||||
|
||||
setCookie(res, token);
|
||||
|
||||
jsonRes(res, {
|
||||
|
||||
Reference in New Issue
Block a user