fix: file config
parent
ecf98298a2
commit
57a1be1c15
|
@ -37,7 +37,14 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const values = await validate()
|
let values = await validate()
|
||||||
|
let config: any = {}
|
||||||
|
for (let item in values) {
|
||||||
|
if (item.startsWith('config.')) {
|
||||||
|
config[item.substring(7)] = values[item]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
values.config = config
|
||||||
setModalProps({ confirmLoading: true })
|
setModalProps({ confirmLoading: true })
|
||||||
if (unref(isUpdate)) {
|
if (unref(isUpdate)) {
|
||||||
await updateFileConfig(values)
|
await updateFileConfig(values)
|
||||||
|
@ -46,8 +53,8 @@ async function handleSubmit() {
|
||||||
}
|
}
|
||||||
closeModal()
|
closeModal()
|
||||||
emit('success')
|
emit('success')
|
||||||
} finally {
|
|
||||||
createMessage.success(t('common.saveSuccessText'))
|
createMessage.success(t('common.saveSuccessText'))
|
||||||
|
} finally {
|
||||||
setModalProps({ confirmLoading: false })
|
setModalProps({ confirmLoading: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue