| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | 
							- /**
 
-  * 后台管理用户数据模型
 
-  *
 
-  * @author CaiAoLin
 
-  * @date 2017/7/20
 
-  * @version
 
-  */
 
- import mongoose from "mongoose";
 
- let Schema = mongoose.Schema;
 
- let collectionName = 'manager';
 
- let modelSchema = {
 
-     // 用户名
 
-     username: {
 
-         type: String,
 
-         index: true
 
-     },
 
-     // 密码
 
-     password: String,
 
-     // token 10位随机字符串(用于加密)
 
-     token: String,
 
-     // 最后登录时间
 
-     last_login: {
 
-         type: Number,
 
-         default: 0
 
-     },
 
-     // 创建时间
 
-     create_time: {
 
-         type: Number,
 
-         default: 0
 
-     },
 
-     // 最后登录ip
 
-     login_ip: {
 
-         type: String,
 
-         default: ''
 
-     },
 
-     // 登录用户电脑信息
 
-     login_info: {
 
-         type: String,
 
-         default: ''
 
-     },
 
-     // 是否可以登录 0为禁止登录
 
-     can_login: {
 
-         type: Number,
 
-         default: 1
 
-     },
 
-     // 权限
 
-     permission: {
 
-         type: String,
 
-         default: ''
 
-     },
 
-     // 办事处
 
-     office: {
 
-         type: Number,
 
-         default: 0
 
-     },
 
-     // 超级管理员 1为超级管理员
 
-     super_admin: {
 
-         type: Number,
 
-         default: 0
 
-     }
 
- };
 
- mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
 
 
  |