mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-25 16:57:14 +08:00
refactor: 优化系统配置相关代码
This commit is contained in:
@@ -25,9 +25,9 @@ export function listCommonDict(code: string) {
|
||||
return http.get<LabelValueState[]>(`${BASE_URL}/dict/${code}`)
|
||||
}
|
||||
|
||||
/** @desc 获取系统参数 */
|
||||
export function listOption(params: OptionQuery) {
|
||||
return http.get<LabelValueState[]>(`${BASE_URL}/option`, params)
|
||||
/** @desc 查询参数列表 */
|
||||
export function listOptionDict(query: OptionQuery) {
|
||||
return http.get<LabelValueState[]>(`${BASE_URL}/dict/option`, query)
|
||||
}
|
||||
|
||||
/** @desc 上传文件 */
|
||||
|
@@ -1,19 +0,0 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/option'
|
||||
|
||||
/** @desc 获取系统配置参数 */
|
||||
export function list(params: System.OptionQuery) {
|
||||
return http.get<System.OptionResp[]>(`${BASE_URL}`, params)
|
||||
}
|
||||
|
||||
/** @desc 保存系统参数 */
|
||||
export function save(req: System.OptionReq[]) {
|
||||
return http.patch(`${BASE_URL}`, req)
|
||||
}
|
||||
|
||||
/** @desc 重置系统参数 */
|
||||
export function resetValue(params: System.OptionQuery) {
|
||||
return http.patch(`${BASE_URL}/value`, params)
|
||||
}
|
@@ -6,4 +6,4 @@ export * from '../monitor/log'
|
||||
export * from './dict'
|
||||
export * from './file'
|
||||
export * from './storage'
|
||||
export * from './config'
|
||||
export * from './option'
|
||||
|
19
src/apis/system/option.ts
Normal file
19
src/apis/system/option.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/option'
|
||||
|
||||
/** @desc 查询参数列表 */
|
||||
export function listOption(query: System.OptionQuery) {
|
||||
return http.get<System.OptionResp[]>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 修改参数 */
|
||||
export function updateOption(data: any) {
|
||||
return http.patch(`${BASE_URL}`, data)
|
||||
}
|
||||
|
||||
/** @desc 重置参数 */
|
||||
export function resetOptionValue(query: System.OptionQuery) {
|
||||
return http.patch(`${BASE_URL}/value`, query)
|
||||
}
|
@@ -198,30 +198,25 @@ export interface StorageQuery extends PageQuery {
|
||||
status?: number
|
||||
}
|
||||
|
||||
/** 系统参数*/
|
||||
export interface OptionQuery {
|
||||
code?: Array<string>
|
||||
}
|
||||
|
||||
export interface OptionReq {
|
||||
code: string
|
||||
value: string
|
||||
}
|
||||
|
||||
/** 系统参数类型 */
|
||||
export interface OptionResp {
|
||||
name?: string
|
||||
name: string
|
||||
code: string
|
||||
value: string
|
||||
description?: string
|
||||
description: string
|
||||
}
|
||||
export interface OptionQuery {
|
||||
code: Array<string>
|
||||
}
|
||||
|
||||
/** 系统配置*/
|
||||
export interface BasicConfigRecordResp {
|
||||
site_title?: string
|
||||
site_copyright?: string
|
||||
site_logo?: string
|
||||
site_favicon?: string
|
||||
/** 基础配置类型 */
|
||||
export interface BasicConfigResp {
|
||||
site_favicon: string
|
||||
site_logo: string
|
||||
site_title: string
|
||||
site_copyright: string
|
||||
}
|
||||
|
||||
/** 绑定三方账号信息*/
|
||||
export interface BindSocialAccountRes {
|
||||
source: string
|
||||
|
Reference in New Issue
Block a user