mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: use cpp std14 as default
This commit is contained in:
1 parent
3487ba3441
commit
1d6c67f04d
4 files changed
+7
-4
No files matched your search
@@ -210,7 +210,7 @@ class UserModel {
|
||||
const op: any = {};
|
||||
if ($set && Object.keys($set).length) op.$set = $set;
|
||||
if ($unset && Object.keys($unset).length) op.$unset = $unset;
|
||||
if (op.$set?.loginIp) op.$addToSet = { ip: op.$set.loginIp };
|
||||
if (op.$set?.loginip) op.$addToSet = { ip: op.$set.loginip };
|
||||
const res = await coll.findOneAndUpdate({ _id: uid }, op, { returnDocument: 'after' });
|
||||
deleteUserCache(res.value);
|
||||
return res;
|
||||
|
||||
@@ -506,7 +506,6 @@ export class Handler extends HandlerCommon {
|
||||
blacklist.get(`ip::${this.request.ip}`),
|
||||
this.getSession(),
|
||||
]);
|
||||
if (bdoc) throw new BlacklistedError(this.request.ip);
|
||||
if (inferDomain && !this.request.path.startsWith('/d/')) {
|
||||
this.domainId = inferDomain._id;
|
||||
this.args.domainId = inferDomain._id;
|
||||
@@ -537,6 +536,7 @@ export class Handler extends HandlerCommon {
|
||||
icon: global.Hydro.lib[key].icon,
|
||||
text: global.Hydro.lib[key].text,
|
||||
}));
|
||||
if (bdoc) throw new BlacklistedError(this.request.ip);
|
||||
if (!this.noCheckPermView && !this.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) this.checkPerm(PERM.PERM_VIEW);
|
||||
if (this.request.method === 'post' && this.request.headers.referer) {
|
||||
const host = new URL(this.request.headers.referer).host;
|
||||
|
||||
Reference in new issue
Block a user