♻️ feat(新增): 环境变量配置

This commit is contained in:
Bunny 2024-09-02 22:25:12 +08:00
parent acb93ca2c9
commit a5953af186
4 changed files with 68 additions and 4 deletions

View File

@ -35,6 +35,7 @@ public class EfCoreContext : DbContext
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
options.UseSqlServer(DbPath).AddInterceptors(new TransactionInterceptor());
}
/// <summary>

View File

@ -2,14 +2,24 @@
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": false,
"launchUrl": "bunnyDocs",
"launchBrowser": true,
"launchUrl": "http://localhost:8900/bunnyDocs",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": false,
"dotnetRunMessages": true,
"applicationUrl": "http://*:8900"
},
"https": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "https://localhost:8848/bunnyDocs",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://*:8848"
},
"Container (Dockerfile)": {
"commandName": "Docker",
"launchBrowser": true,
@ -22,7 +32,7 @@
"useSSL": true
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,

View File

@ -5,5 +5,27 @@
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*",
"DataBase": {
"DataBaseConnection": "192.168.3.98;Initial Catalog=BunnyDemo;TrustServerCertificate=True;Persist Security Info=True;User ID=sa;Password=abc1234.",
"TimeOut": 6
},
"JWT": {
"Issuer": "Issuer",
"Audience": "Audience"
},
"Redis": {
"Host": "47.120.65.66",
"Port": "6379",
"Password": "02120212",
"DefaultDB": 6,
"AsyncTimeout": 300
},
"Minio": {
"Url": "192.168.3.98:9000",
"AccessKey": "bunny",
"SecretKey": "02120212",
"BucketName": "csharp-test"
}
}

View File

@ -0,0 +1,31 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*",
"DataBase": {
"DataBaseConnection": "192.168.3.98;Initial Catalog=BunnyDemo;TrustServerCertificate=True;Persist Security Info=True;User ID=sa;Password=abc1234.",
"TimeOut": 6
},
"JWT": {
"Issuer": "Issuer",
"Audience": "Audience"
},
"Redis": {
"Host": "47.120.65.66",
"Port": "6379",
"Password": "02120212",
"DefaultDB": 6,
"AsyncTimeout": 300
},
"Minio": {
"Url": "192.168.3.98:9000",
"AccessKey": "bunny",
"SecretKey": "02120212",
"BucketName": "csharp-test"
}
}