随笔分类 -  .NetCore

摘要:jwt授权拓展类AddAuth: using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using 阅读全文
posted @ 2021-12-17 16:44 SmilePastaLi 阅读(106) 评论(0) 推荐(0) 编辑
摘要:ActionResponse: namespace Siia.Model.Infrastructure { public class ActionResponse { private static readonly ActionResponse _success = new ActionRespon 阅读全文
posted @ 2021-12-17 16:31 SmilePastaLi 阅读(73) 评论(0) 推荐(0) 编辑
摘要:生成唯一long类型自增Id: using System; namespace ConsoleApp1 { public static class Snowflake { static SnowflakeTool idworker = new SnowflakeTool(1); public sta 阅读全文
posted @ 2021-12-08 16:34 SmilePastaLi 阅读(725) 评论(0) 推荐(0) 编辑
摘要:using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Siia.Model.Infrastructure; using Siia.RedisCache; using Siia 阅读全文
posted @ 2021-12-03 16:19 SmilePastaLi 阅读(267) 评论(0) 推荐(0) 编辑
摘要:过滤器: using Fengling.Activity.App.Request.Member; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Ca 阅读全文
posted @ 2020-04-17 16:57 SmilePastaLi 阅读(2782) 评论(0) 推荐(1) 编辑
摘要:using System; namespace Siia.WxPlatform.Web.Weixin.Helpers { /// <summary> /// 微信 API 工具类 /// </summary> public class ApiUtility { public static int G 阅读全文
posted @ 2020-04-17 16:52 SmilePastaLi 阅读(529) 评论(0) 推荐(0) 编辑
摘要:Startup.cs文件: 登录: 特性: 需要认证:[Authorize] 忽略认证:[AllowAnonymous] 阅读全文
posted @ 2019-07-31 17:33 SmilePastaLi 阅读(1010) 评论(0) 推荐(0) 编辑
摘要:[HttpGet] public async Task OpenOAuthCallback(string auth_code, string appletId) { try { #region 使用ComponentContainer //获取OAuth... 阅读全文
posted @ 2019-07-30 13:32 SmilePastaLi 阅读(337) 评论(0) 推荐(0) 编辑
摘要:public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } ... 阅读全文
posted @ 2019-06-24 17:30 SmilePastaLi 阅读(598) 评论(0) 推荐(0) 编辑
摘要:步骤一、 Nuget Packages安装,使用程序包管理器控制台,安装命令:Install-Package Swashbuckle.AspNetCore -Pre 步骤二、 在Startup 文件中添加配置: 阅读全文
posted @ 2018-08-16 17:11 SmilePastaLi 阅读(153) 评论(0) 推荐(0) 编辑
摘要:appsettings.json 文件: 控制器中读取配置文件: 先创建配置文件的节点对象,然后注入 注意: 控制器中读取配置文件,要先在Startup.cs中的ConfigureServices方法中注入 services.Configure<SiteConfig>(Configuration.G 阅读全文
posted @ 2018-08-16 09:46 SmilePastaLi 阅读(942) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示