diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 5dde1d470..4fab239da 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -1799,6 +1799,11 @@ const cn = { clear: '清空', enable: '启用', update: '更新', + edit: '编辑个人中心', + editProfile: '编辑个人中心', + username: '用户名', + name: '名称', + language: '语言', operationRecord: '操作记录', changePassword: '修改密码', oldPassword: '当前密码', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index b042a5a8d..d9b9738a6 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1682,6 +1682,11 @@ const en = { clear: 'Clear', enable: 'Enable', update: 'Update', + edit: 'Edit profile', + editProfile: 'Edit Profile', + username: 'User name', + name: 'Name', + language: 'Language', operationRecord: 'Operation log', changePassword: 'Change password', oldPassword: 'Current password', diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index 9ef5bb173..90c4e8295 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -213,6 +213,7 @@ export default { sessionStorage.setItem('nz-username', this.loginData.username) localStorage.setItem('nz-username', this.loginData.username) localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled) + localStorage.setItem('nz-language', this.lang) this.loginSuccess(res) } else { this.authToken = res.data.authToken diff --git a/nezha-fronted/src/components/common/rightBox/profileBox.vue b/nezha-fronted/src/components/common/rightBox/profileBox.vue new file mode 100644 index 000000000..6918dec90 --- /dev/null +++ b/nezha-fronted/src/components/common/rightBox/profileBox.vue @@ -0,0 +1,155 @@ + + + + diff --git a/nezha-fronted/src/components/layout/header.vue b/nezha-fronted/src/components/layout/header.vue index 1f715a82b..27fccffff 100644 --- a/nezha-fronted/src/components/layout/header.vue +++ b/nezha-fronted/src/components/layout/header.vue @@ -157,13 +157,13 @@ export default { document.location.href = '/' }) }, - refreshLang () { - this.language = localStorage.getItem('nz-language') - this.$i18n.locale = this.language - this.$nextTick(() => { - window.location.reload() - }) - }, + // refreshLang () { + // this.language = localStorage.getItem('nz-language') + // this.$i18n.locale = this.language + // this.$nextTick(() => { + // // window.location.reload() + // }) + // }, showPinDialog () { // this.showChangePin = true this.$router.push({ @@ -184,7 +184,7 @@ export default { initEvent () { bus.$on('login', () => { this.username = sessionStorage.getItem('nz-username') - this.refreshLang() + // this.refreshLang() }) if (window.history && window.history.pushState) { history.pushState(null, null, document.URL) diff --git a/nezha-fronted/src/components/page/config/profile.vue b/nezha-fronted/src/components/page/config/profile.vue index cd736c9ae..4d9a9d442 100644 --- a/nezha-fronted/src/components/page/config/profile.vue +++ b/nezha-fronted/src/components/page/config/profile.vue @@ -30,6 +30,10 @@ +
@@ -39,7 +43,7 @@
- +
{{$t('profile.twoFactorAuthentication')}}
@@ -126,20 +130,27 @@
+ + +