add checkRootDna
This commit is contained in:
parent
7252da3f1b
commit
884236052e
2 changed files with 35 additions and 2 deletions
|
|
@ -50,7 +50,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
|
|||
|
||||
try {
|
||||
rootId = token
|
||||
? await new permission().checkOrg(token, req.app.locals.logData.userId)
|
||||
? await new permission().checkRootDna(token, req.app.locals.logData.userId)
|
||||
: null;
|
||||
} catch (err) {
|
||||
console.warn("Error fetching rootId:", err);
|
||||
|
|
@ -59,7 +59,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
|
|||
const obj = {
|
||||
logType: res.statusCode >= 500 ? "error" : res.statusCode >= 400 ? "warning" : "info",
|
||||
ip: req.ip,
|
||||
rootId: rootId?.orgRootId ?? null,
|
||||
rootId: rootId?.rootDnaId ?? null,
|
||||
systemName: "KPI",
|
||||
startTimeStamp: timestamp,
|
||||
endTimeStamp: new Date().toISOString(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue