界面语言切换功能,修复nav异常

This commit is contained in:
masnn committed 2020-06-10 23:20:36 +08:00
1 parent 7e7dee4074
commit 0923d6e72b
16 files changed
+53 -36

No files matched your search

+3 -8
View File
@@ -138,8 +138,7 @@ class UserLostPassWithCodeHandler extends Handler {
class UserDetailHandler extends Handler {
async get({ domainId, uid }) {
const isSelfProfile = this.user._id === uid;
const udoc = await user.getById(domainId, uid);
if (!udoc) throw new UserNotFoundError(uid);
const udoc = await user.getById(domainId, uid, true);
const sdoc = await token.getMostRecentSessionByUid(uid);
this.response.template = 'user_detail.html';
this.response.body = { isSelfProfile, udoc, sdoc };
@@ -151,12 +150,8 @@ class UserSearchHandler extends Handler {
let udocs;
if (exactMatch) udocs = [];
else udocs = await user.getPrefixList(q, 20);
try {
const udoc = await user.getById(domainId, parseInt(q));
if (udoc) udocs.push(udoc);
} catch (e) {
/* Ignore */
}
const udoc = await user.getById(domainId, parseInt(q));
if (udoc) udocs.push(udoc);
for (const i in udocs) {
if (udocs[i].gravatar) {
udocs[i].gravatar_url = misc.gravatar(udocs[i].gravatar);