core: use cpp std14 as default

This commit is contained in:
undefined committed 2021-10-21 11:22:42 +08:00
1 parent 3487ba3441
commit 1d6c67f04d
4 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;