修改更新web配置接口
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
cf45582a40
commit
36c1f9e790
|
|
@ -191,7 +191,13 @@ public class DeployConfigService(IMapper _mapper, IConfiguration _configuration,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<IResponseOutput> UpdateWebConfigInfo(string configStr)
|
public class WebConfigCommand
|
||||||
|
{
|
||||||
|
public string ConfigStr { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> UpdateWebConfigInfo(WebConfigCommand incommand)
|
||||||
{
|
{
|
||||||
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
||||||
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
||||||
|
|
@ -205,7 +211,7 @@ public class DeployConfigService(IMapper _mapper, IConfiguration _configuration,
|
||||||
JObject obj = JObject.Parse(text);
|
JObject obj = JObject.Parse(text);
|
||||||
|
|
||||||
// SystemEmailSendConfig 相关配置
|
// SystemEmailSendConfig 相关配置
|
||||||
obj["FrontWebConfig"] = configStr;
|
obj["FrontWebConfig"] = incommand.ConfigStr;
|
||||||
|
|
||||||
// 重新写入appsettings.json
|
// 重新写入appsettings.json
|
||||||
string result = obj.ToString();
|
string result = obj.ToString();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue