mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
update model.user.create() api
This commit is contained in:
1 parent
162d93e5db
commit
37756c3724
14 files changed
+31
-57
No files matched your search
@@ -11,14 +11,7 @@ export async function run({ username = '', password = '' } = {}) {
|
||||
if (username && password) {
|
||||
const udoc = await user.getById('system', -1);
|
||||
if (!udoc) {
|
||||
await user.create({
|
||||
uid: -1,
|
||||
mail: 'root@hydro.local',
|
||||
uname: username,
|
||||
password,
|
||||
regip: '127.0.0.1',
|
||||
priv: PRIV.PRIV_ALL,
|
||||
});
|
||||
await user.create('root@hydro.local', username, password, -1, '127.0.0.1', PRIV.PRIV_ALL);
|
||||
} else {
|
||||
const salt = String.random();
|
||||
await user.setById(-1, {
|
||||
|
||||
Reference in new issue
Block a user