完善翻译

This commit is contained in:
undefined committed 2020-06-20 12:05:44 +08:00
1 parent 7d3bdc2dd1
commit 2d3cee7753
13 files changed
+1308 -1280

No files matched your search

+4 -2
View File
@@ -103,7 +103,6 @@ class HomeSecurityHandler extends Handler {
async get() {
// TODO(iceboy): pagination? or limit session count for uid?
const sessions = await token.getSessionListByUid(this.user._id);
const parsed = [];
for (const session of sessions) {
session.isCurrent = session._id === this.session._id;
session._id = md5(session._id);
@@ -111,7 +110,8 @@ class HomeSecurityHandler extends Handler {
if (geoip) session.updateGeoip = geoip.lookup(session.updateIp || session.createIp);
}
this.response.template = 'home_security.html';
this.response.body = { sessions: parsed, geoipProvider: (geoip || {}).provider };
this.response.body = { sessions, geoipProvider: (geoip || {}).provider };
if (useragent) this.response.body.icon = useragent.icon;
}
async postChangePassword({ current, password, verifyPassword }) {
@@ -160,6 +160,8 @@ class HomeSettingsHandler extends Handler {
}
async get({ category }) {
// eslint-disable-next-line prefer-destructuring
category = category[0]; // Category would be splitted into array
const path = [
['Hydro', 'homepage'],
[`home_${category}`, null],
+2 -2
View File
@@ -127,9 +127,9 @@ class RecordMainConnectionHandler extends RecordConnectionHandler {
// eslint-disable-next-line prefer-const
let [udoc, pdoc] = await Promise.all([
user.getById(this.domainId, rdoc.uid),
problem.get(this.domainId, rdoc.pid),
problem.get(this.domainId, rdoc.pid, null, false),
]);
if (pdoc.hidden && !this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
if (pdoc && pdoc.hidden && !this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
this.send({ html: await this.renderHTML('record_main_tr.html', { rdoc, udoc, pdoc }) });
}
}