1、appsettings.json添加配置项
2、新建一个类,对应配置项名称,例如WxCommon下的:
public class AppSettings : IOptions<AppSettings>
{
public AppSettings Value => this;
/// <summary>
/// 字符串链接
/// </summary>
public string connectionString { get; set; }
/// <summary>
/// 小程序APPID
/// </summary>
public string appID { get; set; }
/// <summary>
/// 小程序密钥
/// </summary>
public string appSecret { get; set; }
}