mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: force uid
This commit is contained in:
1 parent
282d0cdf6b
commit
04b005b825
3 files changed
+10
-5
No files matched your search
@@ -232,7 +232,7 @@ class UserModel {
|
||||
uid: number = 0, regip: string = '127.0.0.1', priv: number = system.get('default.priv'),
|
||||
) {
|
||||
const salt = String.random();
|
||||
if (!uid) {
|
||||
if (typeof uid !== 'number') {
|
||||
const [udoc] = await coll.find({}).sort({ _id: -1 }).limit(1).toArray();
|
||||
uid = Math.max((udoc?._id || 0) + 1, 2);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user