From 1909b6e907f8d8dd00d8e59eff8c2125914cad3f Mon Sep 17 00:00:00 2001 From: Charles7c Date: Tue, 28 May 2024 23:12:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=80=82=E9=85=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8F=82=E6=95=B0=20API=20=E6=96=B0=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/system/type.ts | 4 +++- src/stores/modules/app.ts | 2 +- src/views/system/config/components/MailSetting.vue | 4 ++-- src/views/system/config/components/SecuritySetting.vue | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) 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()