添加配置管理功能,包括获取和设置配置值的接口及实现
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s

This commit is contained in:
孙诚
2026-01-05 15:21:13 +08:00
parent 5a824dac91
commit d44cceb6e4
8 changed files with 306 additions and 22 deletions

28
Web/src/api/config.js Normal file
View File

@@ -0,0 +1,28 @@
import request from './request'
/**
* 获取配置值
* @param {string} key - 配置的key
* @returns {Promise<{success: boolean, data: string}>}
*/
export const getConfig = (key) => {
return request({
url: '/Config/GetConfig',
method: 'get',
params: { key }
})
}
/**
* 设置配置值
* @param {string} key - 配置的key
* @param {string} value - 配置的值
* @returns {Promise<{success: boolean}>}
*/
export const setConfig = (key, value) => {
return request({
url: '/Config/SetConfig',
method: 'post',
params: { key, value }
})
}