ssts-hospital-web-master项目实战记录二十:项目迁移-基础模块实现(config-util)
记录时间:2024-02-26
一、config-util模块实现
framework/utils/config-util
import { ajaxWebApi, ajaxFile } from './ajax-util'
//获取ConnectionString
const GetConnectionString = function (settingName: string) {
return ajaxWebApi(
'/api/System/GetConnectionString',
false,
JSON.stringify({ settingName: settingName })
)
}
//获取AppSetting
const GetAppSetting = function (settingName: string) {
return ajaxWebApi(
'/api/System/GetAppSetting',
false,
JSON.stringify({ settingName: settingName })
)
}
//获取Json配置
const GetJsonConfig = function (jsonFileName: string) {
return ajaxFile(jsonFileName)
}
export { GetConnectionString, GetAppSetting, GetJsonConfig }
二、调用示例
无
三、运行测试
无