mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-22 16:23:28 +00:00
fix: 修改通用创建更新成功后的Route; 优化用户ACL创建ip_group错误时的信息显示
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage
|
||||
v-bind="$data"
|
||||
:clean-form-value="cleanFormValue"
|
||||
@getObjectDone="afterGetUser"
|
||||
/>
|
||||
<GenericCreateUpdatePage v-bind="$data" @getObjectDone="afterGetUser" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -134,6 +130,27 @@ export default {
|
||||
value: []
|
||||
}
|
||||
}
|
||||
},
|
||||
getMethod() {
|
||||
const params = this.$route.params
|
||||
if (params.id) {
|
||||
return 'put'
|
||||
} else {
|
||||
return 'post'
|
||||
}
|
||||
},
|
||||
cleanFormValue(value) {
|
||||
const method = this.getMethod()
|
||||
if (method === 'post' && value.password_strategy === 'email') {
|
||||
delete value['password']
|
||||
if (this.currentOrgIsRoot) {
|
||||
delete value['groups']
|
||||
}
|
||||
}
|
||||
if (value.update_password !== undefined) {
|
||||
delete value.update_password
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -146,27 +163,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cleanFormValue(value) {
|
||||
const method = this.getMethod()
|
||||
if (method === 'post' && value.password_strategy === 'email') {
|
||||
delete value['password']
|
||||
if (this.currentOrgIsRoot) {
|
||||
delete value['groups']
|
||||
}
|
||||
}
|
||||
if (value.update_password !== undefined) {
|
||||
delete value.update_password
|
||||
}
|
||||
return value
|
||||
},
|
||||
getMethod() {
|
||||
const params = this.$route.params
|
||||
if (params.id) {
|
||||
return 'put'
|
||||
} else {
|
||||
return 'post'
|
||||
}
|
||||
},
|
||||
afterGetUser(user) {
|
||||
this.user = user
|
||||
if (this.$route.query.clone_from) {
|
||||
|
Reference in New Issue
Block a user