07 2024 档案
摘要:仓储(Respository)是对数据库访问的一个封装 解决方案新建Respository文件夹,新建类库Web.Core.IRepository,Web.Core.Repository 解决方案新建Services文件夹,新建类库Web.Core.IServices,Web.Core.Servic
阅读全文
摘要:JWT是什么?校验逻辑?授权过程?这里就不过多的阐述了,直接上代码 在appsettings.json中配置jwt参数的值 SecretKey必须大于16个字符 1 { 2 "Logging": { 3 "LogLevel": { 4 "Default": "Information", 5 "Mic
阅读全文
摘要:在.netcore webapi 项目中,我们会把配置信息同意放置在appsettings.json中,通过新建读取帮助类,更加简单的读取配置信息。 新建公共类库文件夹Common,新建公共类库Web.Core.Common 在Web.Core.Common类库下新建Helper文件夹,新建AppS
阅读全文
摘要:1 /// <summary> 2 /// appsettings.json操作类 3 /// </summary> 4 public class AppSettings 5 { 6 static IConfiguration Configuration { get; set; } 7 static
阅读全文