mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
完善设置
This commit is contained in:
1 parent
fc0d9873a2
commit
7edb29d7b8
43 files changed
+219
-184
No files matched your search
@@ -2,7 +2,7 @@ const { defaults } = require('lodash');
|
||||
const db = require('../service/db');
|
||||
const builtin = require('../model/builtin');
|
||||
const system = require('../model/system');
|
||||
const pwhash = require('../lib/pwhash');
|
||||
const pwhash = require('../lib/hash.hydro');
|
||||
const { udoc } = require('../interface');
|
||||
|
||||
const collUser = db.collection('user');
|
||||
@@ -42,7 +42,7 @@ async function run() {
|
||||
}
|
||||
await Promise.all(tasks);
|
||||
try {
|
||||
const salt = pwhash.salt();
|
||||
const salt = String.random();
|
||||
await collUser.insertMany([
|
||||
defaults({
|
||||
_id: 0,
|
||||
@@ -79,4 +79,4 @@ async function run() {
|
||||
await collRole.insertMany(builtin.BUILTIN_ROLES);
|
||||
}
|
||||
|
||||
module.exports = { run };
|
||||
global.Hydro.script.install = module.exports = { run };
|
||||
@@ -5,4 +5,4 @@ async function run() {
|
||||
console.log('Dropped');
|
||||
}
|
||||
|
||||
module.exports = { run };
|
||||
global.Hydro.script.uninstall = module.exports = { run };
|
||||
Reference in new issue
Block a user