perf: 用户来源不是本地时禁用更新密码

This commit is contained in:
Orange
2021-04-01 15:15:02 +08:00
committed by 老广
parent 73c17fccbe
commit be176ad408

View File

@@ -38,8 +38,8 @@ export default {
url: '/api/v1/users/users/',
fieldsMeta: {
password_strategy: {
hidden: () => {
return this.$route.params.id
hidden: (formValue) => {
return this.$route.params.id || formValue.source !== 'local'
}
},
email: {
@@ -64,7 +64,7 @@ export default {
if (formValue.password_strategy) {
return false
}
return !formValue.update_password
return !formValue.update_password || formValue.source !== 'local'
},
el: {
required: false
@@ -77,12 +77,12 @@ export default {
if (formValue.set_public_key) {
return true
}
return this.$route.meta.action !== 'update'
return this.$route.meta.action !== 'update' || formValue.source !== 'local'
}
},
public_key: {
hidden: (formValue) => {
return !formValue.set_public_key
return !formValue.set_public_key || formValue.source !== 'local'
}
},
role: {