This commit is contained in:
Jay
2021-09-01 21:15:26 +08:00
parent 2e05f90851
commit 94837efdee
6 changed files with 51 additions and 45 deletions
+10
View File
@@ -0,0 +1,10 @@
const ALLOW_GROUPS = new Set(['/professorx'])
const mod = {}
module.exports = mod
mod.checkAllow = groups => {
if (!Array.isArray(groups)) return false
return groups.filter(t => ALLOW_GROUPS.has(t)).length > 0
}
+2 -1
View File
@@ -57,7 +57,8 @@ mod.codeMessage = {
CodeUnauthorized: { code: 1004, message: 'unauthorized' },
CodeForbidden: { code: 1005, message: 'forbidden' },
CodeNotFound: { code: 1006, message: 'not found' },
CodeInternalError: { code: 1007, message: 'internal error' }
CodeInternalError: { code: 1007, message: 'internal error' },
CodeAccountNoPermission: { code: 1008, message: 'account no permission' }
}
mod.resp = {