Compare commits
2 Commits
628c1c5b3c
...
f511da7e77
| Author | SHA1 | Date |
|---|---|---|
|
|
f511da7e77 | |
|
|
2cbcf1e56f |
|
|
@ -18,9 +18,10 @@ namespace Learn.Archives.API.Controllers
|
|||
[Route("api/[controller]")]
|
||||
public class PublicController : Controller
|
||||
{
|
||||
|
||||
public PublicController(Repository<School> baseService)
|
||||
private readonly IHostEnvironment _environment;
|
||||
public PublicController(Repository<School> baseService, IHostEnvironment environment)
|
||||
{
|
||||
_environment = environment;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -51,5 +52,29 @@ namespace Learn.Archives.API.Controllers
|
|||
return Enum.GetValues(AppCommon.EnumType[type]).Cast<object>()
|
||||
.ToDictionary(s => (int)s, s => s.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前环境变量,配置文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public IActionResult NewENV()
|
||||
{
|
||||
var envName = _environment.EnvironmentName;
|
||||
var env = "无配置";
|
||||
if (_environment.IsDevelopment())
|
||||
env = "开发环境";
|
||||
else if (_environment.IsStaging())
|
||||
env = "测试/预发布环境";
|
||||
else if (_environment.IsProduction())
|
||||
env = "生产环境";
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
envName,
|
||||
env,
|
||||
AppCommon.Config
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
},
|
||||
"DB": {
|
||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g2o.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=learn.archives;CharSet=utf8mb4;pooling=true;SslMode=None",
|
||||
|
||||
"SqlType": "MySql",
|
||||
"UpdateTable": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"ConnectionString": "redis-service.infra.svc.cluster.local:6379,password=tBHjtmXVRnEywYUfJjQp,defaultDatabase=5"
|
||||
},
|
||||
"DB": {
|
||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||
"SqlType": "MySql",
|
||||
"UpdateTable": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
"ConnectionString": "127.0.0.1:6379,password=Woshiren123,defaultDatabase=10"
|
||||
},
|
||||
"DB": {
|
||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||
"SqlType": "MySql",
|
||||
"UpdateTable": true
|
||||
"UpdateTable": false
|
||||
},
|
||||
"AuthKey": {
|
||||
"Secret": "9FAB7AC7-F1DB-4C56-B84F-044055A34AF2",
|
||||
|
|
|
|||
Loading…
Reference in New Issue