diff --git a/projects/Infrastructure/Sms/NetEasySmsSender.cs b/projects/Infrastructure/Sms/NetEasySmsSender.cs index 0b5c2bd1..38e8df37 100644 --- a/projects/Infrastructure/Sms/NetEasySmsSender.cs +++ b/projects/Infrastructure/Sms/NetEasySmsSender.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.Configuration; +using Infrastructure.Extensions; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -26,9 +27,10 @@ namespace Infrastructure.Sms } this._logger = logger; - this._appUrl = new Uri(configuration.GetSection("sms")?.GetValue("url")); - this._appKey = configuration.GetSection("sms")?.GetValue("key"); - this._appSecret = configuration.GetSection("sms")?.GetValue("secret"); + var values = configuration.GetAppSettings("sms"); + this._appUrl = new Uri(values["url"]); + this._appKey = values["key"]; + this._appSecret = values["secret"]; this._httpClientFactory = httpClientFactory; } diff --git a/projects/Platform/Startup.cs b/projects/Platform/Startup.cs index 0fd383b8..c3433c0d 100644 --- a/projects/Platform/Startup.cs +++ b/projects/Platform/Startup.cs @@ -37,7 +37,7 @@ namespace Platform services.AddTransient(); services.AddTransient(); services.AddTransient(); - if (Env.IsDevelopment() || Configuration.GetSection("AppSettings").GetValue("debug", false)) + if (Env.IsDevelopment()) { services.AddTransient(); services.AddTransient(); diff --git a/projects/Platform/Views/Home/Index.cshtml b/projects/Platform/Views/Home/Index.cshtml index cc2b2e6a..d162fad7 100644 --- a/projects/Platform/Views/Home/Index.cshtml +++ b/projects/Platform/Views/Home/Index.cshtml @@ -10,9 +10,9 @@ { @section scripts{ - - - + + + } } } diff --git a/projects/Platform/appsettings.json b/projects/Platform/appsettings.json index 7fa0e1e5..e50fdfc0 100644 --- a/projects/Platform/appsettings.json +++ b/projects/Platform/appsettings.json @@ -16,7 +16,8 @@ "Database": "MySQL", "FileServer": "MinIO", "Cache": "Redis", - "JobDatabase": "MySQL" + "JobDatabase": "MySQL", + "sms": "url=https://api.netease.im/sms/sendcode.action;key=54ebdf1f4364ddd8ff6f82f88d630a76;secret=c49d42b67798@" }, "ConnectionStrings": { "SQLite": "Data Source=iotcenter.db", diff --git a/publish/build.ps1 b/publish/build.ps1 index be3a6df7..5a232210 100644 --- a/publish/build.ps1 +++ b/publish/build.ps1 @@ -9,15 +9,10 @@ if(Test-Path dist) } echo 'copy src to dist' -Copy-Item ./src/* ./dist -Recurse -Exclude @('./src/linux-x64/publish/log/*','.gitignore','dev.cmd','docker-compose.override.yml','nginx.dev.conf') +Copy-Item ./src/* ./dist -Recurse -Exclude @('.gitignore','dev.cmd','docker-compose.override.yml','nginx.dev.conf') Remove-Item ./dist/linux-x64/publish/log/* -recurse -force Remove-Item ./dist/linux-x64/publish/data/* -recurse -force -#$source = (Get-Item -Path './src').FullName -#$dest = (Get-Item -Path './dist').FullName -#$exclude = @('dev.cmd','docker-compose.override.yml','nginx.dev.conf') -#Get-ChildItem $source -Recurse -Exclude $exclude | where {$_.FullName -notlike (Get-Item -Path './src/linux-x64/publish/log/').FullName} | Copy-Item -Destination {Join-Path $dest $_.FullName.Substring($source.length)} - echo 'copy project files to dist folder' Copy-Item ../projects/WebMVC/wwwroot ./dist/linux-x64/publish/apps/WebMVC/wwwroot -recurse Copy-Item ../projects/WebSPA/wwwroot ./dist/linux-x64/publish/apps/WebSPA/wwwroot -recurse