瀏覽代碼

日志bug

laiguoran 4 年之前
父節點
當前提交
f7cc8049b5
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      app/service/login_logging.js
  2. 2 2
      app/service/project_log.js

+ 1 - 1
app/service/login_logging.js

@@ -39,7 +39,7 @@ module.exports = app => {
          */
         async addLoginLog(type, status) {
             const { ctx } = this;
-            const ipMsg = await ctx.helper.getUserIPMsg();
+            const ipMsg = await this.ctx.helper.getUserIPMsg();
             const payload = {
                 uid: ctx.session.sessionUser.accountId,
                 pid: ctx.session.sessionProject.id,

+ 2 - 2
app/service/project_log.js

@@ -23,11 +23,11 @@ module.exports = app => {
          */
         async addProjectLog(transaction, type, status, msg, tid = 0) {
             const { ctx } = this;
-            const ipMsg = await ctx.helper.getUserIPMsg();
+            const ipMsg = await this.ctx.helper.getUserIPMsg();
             const payload = {
                 uid: ctx.session.sessionUser.accountId,
                 pid: ctx.session.sessionProject.id,
-                tid: ctx.tender.id ? ctx.tender.id : tid,
+                tid: ctx.tender && ctx.tender.id ? ctx.tender.id : tid,
                 type,
                 status,
                 msg,