mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
+4
-3
@@ -164,9 +164,10 @@ export async function inc(_id: number, field: string, n = 1) {
|
||||
return udoc;
|
||||
}
|
||||
|
||||
export async function create({
|
||||
uid = null, mail, uname, password, regip = '127.0.0.1', priv = PRIV.PRIV_DEFAULT,
|
||||
}) {
|
||||
export async function create(
|
||||
mail: string, uname: string, password: string,
|
||||
uid: number, regip = '127.0.0.1', priv = PRIV.PRIV_DEFAULT,
|
||||
) {
|
||||
const salt = String.random();
|
||||
if (!uid) uid = await system.inc('user');
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user