Kaynağa Gözat

日志相关

MaiXinRong 2 yıl önce
ebeveyn
işleme
c93e9d19f5

+ 1 - 1
app/middleware/auto_finish_logger.js

@@ -33,7 +33,7 @@ module.exports = options => {
             };
         } else {
             logData = {
-                id: this.logId, requestTime: ctx.logTime, responseTime, runTime,
+                id: ctx.logId, requestTime: ctx.logTime, responseTime, runTime,
             };
         }
         const bLogger = runTime > 500 ? ctx.getLogger('warning') : ctx.getLogger('finish');

+ 1 - 1
app/service/global_log.js

@@ -36,7 +36,7 @@ module.exports = app => {
         }
 
         async responseLog(runTime){
-            if (!this.ctx.session) return;
+            if (!this.ctx.session || !this.ctx.session.sessionProject || !this.ctx.session.sessionUser) return;
 
             await this.defaultUpdate({ id: this.ctx.logId, is_response: 1, run_time: runTime });
         }