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
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.39.30",
"version": "2.39.31",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+4 -1
View File
@@ -37,7 +37,7 @@ langs:
monaco: cpp
display: C
cc:
compile: /usr/bin/g++ -Wall -std=c++11 -o ${name} foo.cc -lm
compile: /usr/bin/g++ -Wall -std=c++14 -o ${name} foo.cc -lm
code_file: foo.cc
highlight: cpp astyle-c
monaco: cpp
@@ -46,7 +46,10 @@ langs:
compile: /usr/bin/g++ -Wall -std=c++98 -o ${name} foo.cc -lm
display: C++ 98
cc.std11:
compile: /usr/bin/g++ -Wall -std=c++11 -o ${name} foo.cc -lm
display: C++ 11
cc.std14:
display: C++ 14
cc.std17:
compile: /usr/bin/g++ -Wall -std=c++17 -o ${name} foo.cc -lm
display: C++ 17
+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;