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", "name": "hydrooj",
"version": "2.39.30", "version": "2.39.31",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+4 -1
View File
@@ -37,7 +37,7 @@ langs:
monaco: cpp monaco: cpp
display: C display: C
cc: 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 code_file: foo.cc
highlight: cpp astyle-c highlight: cpp astyle-c
monaco: cpp monaco: cpp
@@ -46,7 +46,10 @@ langs:
compile: /usr/bin/g++ -Wall -std=c++98 -o ${name} foo.cc -lm compile: /usr/bin/g++ -Wall -std=c++98 -o ${name} foo.cc -lm
display: C++ 98 display: C++ 98
cc.std11: cc.std11:
compile: /usr/bin/g++ -Wall -std=c++11 -o ${name} foo.cc -lm
display: C++ 11 display: C++ 11
cc.std14:
display: C++ 14
cc.std17: cc.std17:
compile: /usr/bin/g++ -Wall -std=c++17 -o ${name} foo.cc -lm compile: /usr/bin/g++ -Wall -std=c++17 -o ${name} foo.cc -lm
display: C++ 17 display: C++ 17
+1 -1
View File
@@ -210,7 +210,7 @@ class UserModel {
const op: any = {}; const op: any = {};
if ($set && Object.keys($set).length) op.$set = $set; if ($set && Object.keys($set).length) op.$set = $set;
if ($unset && Object.keys($unset).length) op.$unset = $unset; 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' }); const res = await coll.findOneAndUpdate({ _id: uid }, op, { returnDocument: 'after' });
deleteUserCache(res.value); deleteUserCache(res.value);
return res; return res;
+1 -1
View File
@@ -506,7 +506,6 @@ export class Handler extends HandlerCommon {
blacklist.get(`ip::${this.request.ip}`), blacklist.get(`ip::${this.request.ip}`),
this.getSession(), this.getSession(),
]); ]);
if (bdoc) throw new BlacklistedError(this.request.ip);
if (inferDomain && !this.request.path.startsWith('/d/')) { if (inferDomain && !this.request.path.startsWith('/d/')) {
this.domainId = inferDomain._id; this.domainId = inferDomain._id;
this.args.domainId = inferDomain._id; this.args.domainId = inferDomain._id;
@@ -537,6 +536,7 @@ export class Handler extends HandlerCommon {
icon: global.Hydro.lib[key].icon, icon: global.Hydro.lib[key].icon,
text: global.Hydro.lib[key].text, 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.noCheckPermView && !this.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) this.checkPerm(PERM.PERM_VIEW);
if (this.request.method === 'post' && this.request.headers.referer) { if (this.request.method === 'post' && this.request.headers.referer) {
const host = new URL(this.request.headers.referer).host; const host = new URL(this.request.headers.referer).host;