Merge pull request #3217 from jumpserver/pr@dev@user_change_password

fix: 修改密码时 判断管理员校验规则失败
This commit is contained in:
feng626
2023-06-15 12:14:50 +08:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -45,7 +45,10 @@ export default {
new_password: {
label: this.$t('users.NewPassword'),
rules: [rules.RequiredChange],
component: UserPassword
component: UserPassword,
el: {
userIsOrgAdmin: false
}
},
new_password_again: {
label: this.$t('users.ConfirmPassword'),
@@ -57,6 +60,9 @@ export default {
}
}
},
mounted() {
this.fieldsMeta.new_password.el.userIsOrgAdmin = this.object['is_org_admin']
},
methods: {
submitMethod() {
return 'put'

View File

@@ -193,7 +193,7 @@ export default {
methods: {
afterGetUser(user) {
this.user = user
this.fieldsMeta.password.el.userIsOrgAdmin = user.role === 'Admin' || user.org_roles.indexOf('Admin') !== -1
this.fieldsMeta.password.el.userIsOrgAdmin = user['is_org_admin']
if (this.$route.query.clone_from) {
this.user.groups = []
}