.net core中的配置文件可以存一些自定義的值,我們需要去讀取
在配置中添加json:
"name": "sealee", "ConnectionStrings": { "SqlServerConnection": "Development.json" }, "JwtSettings": { "Issuer": "ss", "Audience": "aa", "SecretKey": "djwidwhjidwjd" },
①介紹
②控制器中怎么得到對象配置
GetSection,GetChildren,Exists的介紹:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#getsection-getchildren-and-exists