mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-27 14:57:08 +08:00
feat: 新增系统配置
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import http from '@/utils/http'
|
||||
import type { LabelValueState } from '@/types/global'
|
||||
import type { TreeNodeData } from '@arco-design/web-vue'
|
||||
import type {OptionQuery} from '@/apis'
|
||||
|
||||
const BASE_URL = '/common'
|
||||
|
||||
@@ -24,6 +25,11 @@ 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 uploadFile(data: FormData) {
|
||||
return http.post(`${BASE_URL}/file`, data)
|
||||
|
19
src/apis/system/config.ts
Normal file
19
src/apis/system/config.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 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,3 +6,4 @@ export * from './log'
|
||||
export * from './dict'
|
||||
export * from './file'
|
||||
export * from './storage'
|
||||
export * from './config'
|
||||
|
@@ -233,4 +233,29 @@ export type StorageResp = {
|
||||
export interface StorageQuery extends PageQuery {
|
||||
description?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
/** 系统参数*/
|
||||
export interface OptionQuery {
|
||||
code?: Array<string>
|
||||
}
|
||||
|
||||
export interface OptionReq {
|
||||
code: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface OptionResp {
|
||||
name?: string
|
||||
code: string
|
||||
value: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
/** 系统配置*/
|
||||
export interface BasicConfigRecordResp {
|
||||
site_title?: string
|
||||
site_copyright?: string
|
||||
site_logo?: string
|
||||
site_favicon?: string
|
||||
}
|
Reference in New Issue
Block a user