2019年9月4日

安装Consul环境并启动

摘要: 1.https://www.consul.io/downloads.html 下载windows 64bit 2. 安装说明 https://blog.csdn.net/zhaokejin521/article/details/78659049 3.启动 进入Consul安装目录 输入以下cmd 命 阅读全文

posted @ 2019-09-04 14:16 一只狐狸。 阅读(5510) 评论(0) 推荐(0) 编辑

2019年8月30日

格式化日期,首字母大写

摘要: 1.添加 Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson -Version 3.0.0-preview8.19405.7 2.格式化 services.AddRazorPages().AddNewtonsoftJson(options 阅读全文

posted @ 2019-08-30 17:37 一只狐狸。 阅读(214) 评论(0) 推荐(0) 编辑

2019年8月21日

设计模式

摘要: https://www.jianshu.com/p/cff1ee13b78a 阅读全文

posted @ 2019-08-21 11:23 一只狐狸。 阅读(104) 评论(0) 推荐(0) 编辑

用户刷新页面,中止客户端面请求,怎么判断服务端也取消请求

摘要: https://www.jianshu.com/p/9988f2a27f8d 阅读全文

posted @ 2019-08-21 10:35 一只狐狸。 阅读(249) 评论(0) 推荐(0) 编辑

2019年8月12日

Token使用

摘要: 1.NeGet添加包 IdentityModel和System.IdentityModel.Tokens.Jwt和Microsoft.AspNetCore.Authorization 2.Startup.cs注册 3.添加中间件 app.UseAuthentication(); 4.写入Token 阅读全文

posted @ 2019-08-12 15:17 一只狐狸。 阅读(609) 评论(0) 推荐(0) 编辑

IdentityServer4搭建和使用

摘要: 1.NuGet引用 IdentityServer4.AccessTokenValidation 2.Startup.cs注册 3.注册中件间 4.使用细节 5.注意:必须执行一个完整的页面才可以,也就是说执行完登陆代码之后,在另外的页面获取HttpContext.User.Claims才可以获取到, 阅读全文

posted @ 2019-08-12 09:45 一只狐狸。 阅读(1236) 评论(0) 推荐(0) 编辑

2019年8月9日

Filter 过滤器

摘要: 1.Action前和Action后 IActionFilter(还须要继承特性) 2. 异常处理的Filter ExceptionFilterAttribute 3.请求页面前,没有进控制器 IResourceFilter 4.返回结果 阅读全文

posted @ 2019-08-09 17:58 一只狐狸。 阅读(252) 评论(0) 推荐(0) 编辑

添加Filter 并控制它的执行顺序

摘要: 1都是加在方法或者控制器头上 [TypeFilter(typeof(CustomControllerActionFilterAttribute),Order =-1)] 2.都是加在方法或者控制器头上 [ServiceFilter(typeof(CustomActionFilterAttribute 阅读全文

posted @ 2019-08-09 17:43 一只狐狸。 阅读(384) 评论(0) 推荐(0) 编辑

在startup 添加数据库链接字符串

摘要: services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SqlServerConnection"))); 阅读全文

posted @ 2019-08-09 17:13 一只狐狸。 阅读(366) 评论(0) 推荐(0) 编辑

添加 Startup 中间件

摘要: 1. app.UseMiddleware<ElevenStopMiddleware>(); 2. public class ElevenStopMiddleware { private readonly RequestDelegate _next; public ElevenStopMiddlewa 阅读全文

posted @ 2019-08-09 17:09 一只狐狸。 阅读(231) 评论(0) 推荐(0) 编辑

导航