login_logging.js 611 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. /**
  3. * 登录日志-数据模型
  4. *
  5. * @author lanjianrong
  6. * @date 2020/8/31
  7. * @version
  8. */
  9. module.exports = app => {
  10. class LoginLogging extends app.BaseService {
  11. constructor(ctx) {
  12. super(ctx);
  13. this.tableName = 'login_logging';
  14. }
  15. async addLoginLog()
  16. /**
  17. * 创建记录
  18. * @param {Object} payload - 载荷
  19. */
  20. async create(payload) {
  21. const result = this.db.insert(this.tableName, payload);
  22. return result && result.affectedRows > 1;
  23. }
  24. }
  25. return LoginLogging;
  26. };