ui: easy locale change

This commit is contained in:
undefined committed 2021-09-18 21:38:33 +08:00
1 parent 761a885560
commit 98c23bb2cc
5 files changed
+13 -5

No files matched your search

-3
View File
@@ -527,9 +527,6 @@ export class Handler extends HandlerCommon {
this.session.scope = PERM.PERM_ALL.toString();
this.user = await user.getById(domainId, this.session.uid, this.session.scope);
}
if (!this.session._id && this.request.headers['accept-language'] && !this.request.headers['accept-language'].startsWith('zh')) {
this.session.viewLang = 'en';
}
if (this.user._id === 0 && this.session.viewLang) this.user.viewLang = this.session.viewLang;
this.user.avatarUrl = avatar(this.user.avatar, 128);
this.csrfToken = this.getCsrfToken(this.session._id || String.random(32));