摘要: https://help.aliyun.com/knowledge_detail/40861.html 阅读全文
posted @ 2020-06-22 19:02 战时事 阅读(396) 评论(0) 推荐(0) 编辑
摘要: .net core 3.1 在Linux上发布的时候遇到如下问题: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery[7] An exception was thrown while deserializing the token.Microso 阅读全文
posted @ 2020-06-19 18:27 战时事 阅读(3367) 评论(0) 推荐(0) 编辑
摘要: .net core 分布式部署时,不使用Session,使用Redis+Cookie存储数据, 但是会涉及到DataProtection的使用; 解决方法使用DataProtection到持续化到Redis中; Redis 不能使用Microsoft.Extensions.Caching.Redis 阅读全文
posted @ 2020-06-19 18:18 战时事 阅读(1885) 评论(0) 推荐(0) 编辑
摘要: .net core 使用Redis安装包:Microsoft.Extensions.Caching.Redis 注册Redis(已经引用了Autofac) public void ConfigureServices(IServiceCollection services) { // 这个是之前使用S 阅读全文
posted @ 2020-06-16 11:55 战时事 阅读(299) 评论(0) 推荐(0) 编辑
摘要: public void ConfigureServices(IServiceCollection services) { services.AddCors(Options => { //无任何限制 Options.AddPolicy("any", builder => { builder.Allow 阅读全文
posted @ 2020-06-16 10:50 战时事 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 1、JWT 可以被解密看到payload数据是否不安全?payload 中放的是非敏感数据,可以被解密看到headers和payload,但是看不到Key,所以其他人不能生成你的token,你的接口便只能用你自己生成的Token 2、HS*与RS*加密算法有何不同?HS256为对称加密算法故密钥只有 阅读全文
posted @ 2020-04-15 12:45 战时事 阅读(425) 评论(0) 推荐(0) 编辑
摘要: .NET Core使用EF时 报错如下信息:The entity type 'XXX' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()' 源代码为: 阅读全文
posted @ 2020-04-10 14:21 战时事 阅读(9027) 评论(0) 推荐(0) 编辑
摘要: .net Core使用EF简单版:一、Nuget导入EF库 二、写实体Model (个人喜欢DBFirst,但是Core里不能直接导入库,所以手写吧) 三、写 DBContxt 四、验证是否成功一:SQLServer/MySQL导入的库 二、实体类 1 using System; 2 using S 阅读全文
posted @ 2020-04-10 14:17 战时事 阅读(1049) 评论(0) 推荐(0) 编辑
摘要: 在Asp.NET MVC中使用Unity: 第一步: NuGet 安装 unity、unity 第二步: 在Global.asax.cs的Application_Start方法中添加对UnityConfig.RegisterComponents()的调用 然后,Web API框架将使用Unity.W 阅读全文
posted @ 2020-04-09 23:06 战时事 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 今天学习了网易云课堂的 盛派的微信开发课程之OAuth微信网页授权:OAuth原理,边听边来波笔记; 1、什么是OAuth? OAuth 你的接口提供给别人使用,你需要提供Oauth,可以让被人使用,也可以使用别人的OAuthOAuth2.0安全性更高 OAuth2.0的流程 开发者服务器或APP 阅读全文
posted @ 2018-07-17 18:16 战时事 阅读(552) 评论(0) 推荐(0) 编辑