You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
814 B
43 lines
814 B
'use strict';
|
|
|
|
module.exports = app => {
|
|
const mongoose = app.mongoose;
|
|
const Schema = mongoose.Schema;
|
|
|
|
const UserSchema = new Schema({
|
|
submission: {
|
|
username: {
|
|
type: String,
|
|
unique: true,
|
|
index: true
|
|
},
|
|
password: {
|
|
type: String,
|
|
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('user', UserSchema, "user");
|
|
};
|
|
|