mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: optimize token.getRecent
This commit is contained in:
1 parent
50b8343ad9
commit
2c3fd7364a
3 files changed
+5
-6
No files matched your search
@@ -2,7 +2,7 @@ import moment from 'moment-timezone';
|
||||
import {
|
||||
UserAlreadyExistError, InvalidTokenError, VerifyPasswordError,
|
||||
UserNotFoundError, SystemError, BlacklistedError,
|
||||
UserFacingError, LoginError, NotFoundError,
|
||||
UserFacingError, LoginError,
|
||||
} from '../error';
|
||||
import { User } from '../interface';
|
||||
import {
|
||||
@@ -178,7 +178,7 @@ class UserLostPassWithCodeHandler extends Handler {
|
||||
class UserDetailHandler extends Handler {
|
||||
@param('uid', Types.Int)
|
||||
async get(domainId: string, uid: number) {
|
||||
if (uid === 0) throw new NotFoundError(this.request.path);
|
||||
if (uid === 0) throw new UserNotFoundError(0);
|
||||
const isSelfProfile = this.user._id === uid;
|
||||
const udoc = await user.getById(domainId, uid);
|
||||
if (!udoc) throw new UserNotFoundError(uid);
|
||||
|
||||
Reference in new issue
Block a user