mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
feat: validator decorator
This commit is contained in:
1 parent
ba03d7a7bf
commit
4e85b696c0
23 files changed
+313
-180
No files matched your search
@@ -42,7 +42,7 @@ export function getMany(query: any, sort: any, page: number, limit: number) {
|
||||
.toArray();
|
||||
}
|
||||
|
||||
export function getMulti(query: any) {
|
||||
export function getMulti(query: any = {}) {
|
||||
return coll.find(query);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,10 @@ export class User {
|
||||
|
||||
role: string;
|
||||
|
||||
regip: () => string;
|
||||
|
||||
loginip: () => string;
|
||||
|
||||
constructor(udoc, dudoc) {
|
||||
this.udoc = () => udoc;
|
||||
this.dudoc = () => dudoc;
|
||||
@@ -55,7 +59,9 @@ export class User {
|
||||
this.hashType = udoc.hashType || 'hydro';
|
||||
this.priv = udoc.priv;
|
||||
this.regat = udoc.regat;
|
||||
this.regip = () => udoc.regip;
|
||||
this.loginat = udoc.loginat;
|
||||
this.loginip = () => udoc.loginip;
|
||||
this.perm = dudoc.perm;
|
||||
this.role = dudoc.role || 'default';
|
||||
|
||||
|
||||
Reference in new issue
Block a user