12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 'use strict';
- module.exports = app => {
- const mongoose = app.mongoose;
- const Schema = mongoose.Schema;
- const SysLogSchema = new Schema({
- loginName: { type: String }, // 登录人-name
- // tableName: { type: String }, // 操作表名
- type: { type: String }, // 操作类型
- detail: { type: String }, // 操作详情
- ipAddress: { type: String }, // IP地址
- state: { type: String }, // PC WeiXin Applets
- time: { type: Date, default: Date.now }, // 创建时间
- // 补充字段
- dept1: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept2: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept3: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept4: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept5: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- role: {
- type: Schema.Types.ObjectId,
- ref: 'sysRole',
- }, // 登录人-角色
- });
- return mongoose.model('sysLog', SysLogSchema, 'sys_log');
- };
|