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
bc50913e6e
commit
2b6a510c1e
23 files changed
+321
-191
No files matched your search
@@ -44,7 +44,7 @@ const validate = {
|
||||
pid: (pid) => (Number.isSafeInteger(parseInt(pid)) ? parseInt(pid) : pid),
|
||||
content: validator.checkContent,
|
||||
title: validator.checkTitle,
|
||||
uid: parseInt(validator.checkUid),
|
||||
uid: (uid) => parseInt(validator.checkUid(uid)),
|
||||
password: validator.checkPassword,
|
||||
mail: validator.checkEmail,
|
||||
uname: validator.checkUname,
|
||||
@@ -58,12 +58,14 @@ const validate = {
|
||||
if (duration <= 0) throw new ValidationError('duration');
|
||||
return duration;
|
||||
},
|
||||
pids: (pids) => pids.split(',').map((i) => i.trim()),
|
||||
role: validator.checkRole,
|
||||
roles: (roles) => {
|
||||
for (const i of roles) validator.checkRole(i);
|
||||
return roles;
|
||||
pids: (pids) => {
|
||||
const res = pids.split(',').map((i) => i.trim());
|
||||
for (const i in res) {
|
||||
if (Number.isSafeInteger(parseInt(res[i]))) res[i] = parseInt(res[i]);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
role: validator.checkRole,
|
||||
penaltyRules: (penaltyRules) => {
|
||||
try {
|
||||
penaltyRules = yaml.safeLoad(penaltyRules);
|
||||
|
||||
Reference in new issue
Block a user