mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-09 08:57:14 +08:00
refactor: 适配系统参数 API 新的使用方式
This commit is contained in:
@@ -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<string>
|
||||
code?: Array<string>
|
||||
category?: string
|
||||
}
|
||||
|
||||
/** 基础配置类型 */
|
||||
|
@@ -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) => {
|
||||
|
@@ -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()
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user