const bcrypt = require('bcrypt')
const {resolve} = require('path')
const glob = require('glob') // 路径匹配规则
const SALT_WORK_FACTOR = 8; // 加盐
const MAX_LOGIN = 5; // 最大登录次数
const LOCK_TIME = 2 * 360000 // 锁定时间,默认 2小时
export const initSchema = () => {
glob.sync(resolve(__dirname, './schema', '**/*.js').forEach(require))
}
bcrypt.genSalt(SALT_WORK_FACTOR, (err, salt) => {
if(err) return next(err);
bcrypt.hash(user.passowrd, salt)
})