diff --git a/.gitignore b/.gitignore index f387679..91361d9 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ npm-debug.log* .pnpm-debug.log tests/**/coverage/ +# 本机调试debug配置文件 +.vscode/launch.json + # Editor directories and files .idea *.suo diff --git a/src/api/system/config.ts b/src/api/system/config.ts new file mode 100644 index 0000000..f21e0da --- /dev/null +++ b/src/api/system/config.ts @@ -0,0 +1,76 @@ +import { http } from "@/utils/http"; + +export interface ConfigQuery extends BasePageQuery { + /** + * 配置key + */ + configKey?: string; + /** + * 配置名称 + */ + configName?: string; + /** + * 是否允许更改配置 + */ + isAllowChange?: string; +} + +/** + * ConfigDTO, 配置信息 + */ +export interface ConfigDTO { + configId?: string; + configKey?: string; + configName?: string; + configOptions?: string[]; + configValue?: string; + createTime?: Date; + isAllowChange?: string; + isAllowChangeStr?: string; + remark?: string; +} + +/** + * ConfigUpdateCommand + */ +export interface UpdateConfigRequest { + configValue: string; +} + +/** 获取配置列表 */ +export const getConfigListApi = (params?: ConfigQuery) => { + return http.request>>( + "get", + "/system/configs", + { + params + } + ); +}; + +/** 获取配置信息 */ +export const getConfigInfoApi = (configId: string) => { + return http.request>( + "get", + `/system/config/${configId}` + ); +}; + +/** 刷新配置缓存 */ +export const updateConfigApi = ( + configId: number, + data: UpdateConfigRequest +) => { + return http.request>>( + "put", + `/system/config/${configId}`, + { + data + } + ); +}; + +/** 刷新配置缓存 */ +export const refreshConfigCacheApi = () => { + return http.request>("delete", "/system/configs/cache"); +}; diff --git a/src/views/system/config/form.vue b/src/views/system/config/form.vue new file mode 100644 index 0000000..5e35021 --- /dev/null +++ b/src/views/system/config/form.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index ab32c30..7511b33 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -1,24 +1,21 @@