37 lines
753 B

'use strict';
module.exports = app => {
const mongoose = app.mongoose;
const Schema = mongoose.Schema;
const UserLoginRecordSchema = new Schema({
username: {
type: String,
ref: 'User',
index: true
},
role: { //角色信息,默认操作员
type: String,
default: 'operator',
index: true
},
delete: {
type: Number,
default: 0, //0代表未删除,1代表删除
index: true
},
create_at: {
type: Date,
default: Date.now,
index: true
},
update_at: {
type: Date,
default: Date.now,
index: true
},
}, {
strict: false
});
return mongoose.model('userLoginRecord', UserLoginRecordSchema, "userLoginRecord");
};