diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 9ceecc9..a542dfd 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -263,6 +263,7 @@ export interface StoragePageQuery extends StorageQuery, PageQuery { /** 系统参数类型 */ export interface OptionResp { + id: string name: string code: string value: string @@ -270,7 +271,8 @@ export interface OptionResp { } export interface OptionQuery { - code: Array + code?: Array + category?: string } /** 基础配置类型 */ diff --git a/src/stores/modules/app.ts b/src/stores/modules/app.ts index c3b0007..83a1f5b 100644 --- a/src/stores/modules/app.ts +++ b/src/stores/modules/app.ts @@ -59,7 +59,7 @@ const storeSetup = () => { // 初始化系统配置 const initSiteConfig = () => { listOptionDict({ - code: ['SITE_FAVICON', 'SITE_LOGO', 'SITE_TITLE', 'SITE_COPYRIGHT'] + category: 'SITE' }).then((res) => { const resMap = new Map() res.data.forEach((item) => { diff --git a/src/views/system/config/components/MailSetting.vue b/src/views/system/config/components/MailSetting.vue index 39e67fa..67f934c 100644 --- a/src/views/system/config/components/MailSetting.vue +++ b/src/views/system/config/components/MailSetting.vue @@ -125,7 +125,7 @@ const handleCancel = () => { } const queryForm = { - code: Object.keys(mailConfig.value) + category: 'MAIL' } // 查询列表数据 const getDataList = async () => { @@ -143,7 +143,7 @@ const handleSave = async () => { if (isInvalid) return false await updateOption( Object.entries(form).map(([key, value]) => { - return { code: key, value } + return { id: mailConfig.value[key].id, code: key, value } }) ) await getDataList() diff --git a/src/views/system/config/components/SecuritySetting.vue b/src/views/system/config/components/SecuritySetting.vue index 9646ecc..e3de3aa 100644 --- a/src/views/system/config/components/SecuritySetting.vue +++ b/src/views/system/config/components/SecuritySetting.vue @@ -160,7 +160,7 @@ const handleCancel = () => { } const queryForm = { - code: Object.keys(securityConfig.value) + category: 'PASSWORD' } // 查询列表数据 const getDataList = async () => { @@ -178,7 +178,7 @@ const handleSave = async () => { if (isInvalid) return false await updateOption( Object.entries(form).map(([key, value]) => { - return { code: key, value } + return { id: securityConfig.value[key].id, code: key, value } }) ) await getDataList()