From a38f179acbd27f7f23ecbebd16d12647e42abb02 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 4 Jun 2020 18:32:23 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalInformationImprovement.vue | 3 ++ src/userviews/users/UserProfile/index.vue | 38 ++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue b/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue index f12339171..e4eccf524 100644 --- a/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue +++ b/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue @@ -59,6 +59,9 @@ export default { type: 'textarea', placeholder: 'ssh-rsa AAAA...' }, + hidden: (formValue) => { + return formValue.source !== 'local' + }, helpText: this.$t('users.HelpText.SSHKeyOfProfileSSHUpdatePage') }, terms: { diff --git a/src/userviews/users/UserProfile/index.vue b/src/userviews/users/UserProfile/index.vue index a464d89ef..08b0792a4 100644 --- a/src/userviews/users/UserProfile/index.vue +++ b/src/userviews/users/UserProfile/index.vue @@ -27,15 +27,28 @@ export default { config: { title: this.$t('users.Profile'), activeMenu: 'ProfileInfo', - submenu: [ - { - title: this.$t('common.BasicInfo'), - name: 'ProfileInfo' - }, - { - title: this.$t('users.ProfileSetting'), - name: 'ProfileUpdate' - }, + submenu: this.getSubmenu(), + hasRightSide: false, + actions: { + detailApiUrl: '/api/v1/users/profile/' + } + } + } + }, + methods: { + getSubmenu() { + let submenu = [ + { + title: this.$t('common.BasicInfo'), + name: 'ProfileInfo' + }, + { + title: this.$t('users.ProfileSetting'), + name: 'ProfileUpdate' + } + ] + if (this.$store.state.users.profile.source === 'local') { + submenu = submenu.concat([ { title: this.$t('users.LoginPasswordSetting'), name: 'PasswordUpdate' @@ -44,12 +57,9 @@ export default { title: this.$t('users.SSHKeySetting'), name: 'SSHUpdate' } - ], - hasRightSide: false, - actions: { - detailApiUrl: '/api/v1/users/profile/' - } + ]) } + return submenu } } }