mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-22 16:47:03 +00:00
perf: 优化钉钉企业微信提交
This commit is contained in:
parent
8bd77fa6c9
commit
fa6831b743
@ -16,6 +16,7 @@
|
||||
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
|
||||
import UserPassword from '@/components/FormFields/UserPassword'
|
||||
import { IBox } from '@/components'
|
||||
import rules from '@/components/DataForm/rules'
|
||||
|
||||
export default {
|
||||
name: 'PasswordUpdate',
|
||||
@ -42,8 +43,8 @@ export default {
|
||||
},
|
||||
new_password: {
|
||||
label: this.$t('users.NewPassword'),
|
||||
component: UserPassword,
|
||||
rules: []
|
||||
rules: [rules.RequiredChange],
|
||||
component: UserPassword
|
||||
},
|
||||
new_password_again: {
|
||||
label: this.$t('users.ConfirmPassword'),
|
||||
|
@ -7,6 +7,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:more-buttons="moreButtons"
|
||||
:has-detail-in-msg="false"
|
||||
:clean-form-value="cleanFormValue"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
@ -56,6 +57,13 @@ export default {
|
||||
methods: {
|
||||
getMethod() {
|
||||
return 'put'
|
||||
},
|
||||
// 不清理的话,编辑secret,在删除提交会报错
|
||||
cleanFormValue(data) {
|
||||
if (!data['DINGTALK_APPSECRET']) {
|
||||
delete data['DINGTALK_APPSECRET']
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<GenericCreateUpdateForm
|
||||
:fields="fields"
|
||||
:url="url"
|
||||
:perform-submit="performSubmit"
|
||||
:clean-form-value="cleanFormValue"
|
||||
:get-method="getMethod"
|
||||
:fields-meta="fieldsMeta"
|
||||
:more-buttons="moreButtons"
|
||||
@ -94,18 +94,13 @@ export default {
|
||||
getMethod() {
|
||||
return 'put'
|
||||
},
|
||||
performSubmit(validValues) {
|
||||
Object.keys(validValues).forEach(
|
||||
function(key) {
|
||||
if (validValues[key] === null) {
|
||||
delete validValues[key]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return this.$axios['put'](`/api/v1/settings/setting/?category=email`, validValues)
|
||||
// 不清理的话,编辑secret,在删除提交会报错
|
||||
cleanFormValue(data) {
|
||||
if (!data['EMAIL_HOST_PASSWORD']) {
|
||||
delete data['EMAIL_HOST_PASSWORD']
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:more-buttons="moreButtons"
|
||||
:has-detail-in-msg="false"
|
||||
:clean-form-value="cleanFormValue"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
@ -56,6 +57,13 @@ export default {
|
||||
methods: {
|
||||
getMethod() {
|
||||
return 'put'
|
||||
},
|
||||
// 不清理的话,编辑secret,在删除提交会报错
|
||||
cleanFormValue(data) {
|
||||
if (!data['WECOM_SECRET']) {
|
||||
delete data['WECOM_SECRET']
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user