继承 IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// 状态码 /// </summ[......]继续阅读
继承 IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// 状态码 /// </summ[......]继续阅读
Inheriting from IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// Status code[......]继续阅读
There are readers suggesting to use app.UseExceptionHandler(); for global exception interception. https://learn.microsoft.com/en-us/aspnet/core/fundam[......] 继续阅读
有读者回复推荐全局异常拦截使用 app.UseExceptionHandler();。 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-9.0 跟本身的主要区别是请求到[......] 继续阅读
Directly use the .NET CLR library for generation without relying on third-party frameworks. The code has been updated to the latest implementation, re[......] 继续阅读
直接使用 .NET 的 CLR 库生成,不依赖第三方框架。 已将代码修正为最新实现,去掉过时接口。 基于密码的密钥导出函数2(PBKDF2)让别人更难通过穷举法猜到你的帐户密码。 pbkdf2 加密是不可逆的,因此可以用来处理密码等,只能对比,不能还原。 比如说,每个用户设置一个加密密钥,每个用户使[......] 继续阅读
When directly using the API to get a Claim, the correctness of the Token's key is not checked. var jwt = jwtSecurityTokenHandler.ReadJ[......]继续阅读
当直接使用 API 获取 Claim 时,是不会检查 Token 的密钥是否正确的。 var jwt = jwtSecurityTokenHandler.ReadJwtToken(token); 如果要同时检查 Token,则可以这样使用: [......]继续阅读
Common JSON serialization configuration is as follows: // JSON serialization configuration private static readonly JsonSerializerOpti[......]继续阅读
常用的 Json 序列化配置如下: // json 序列化配置 private static readonly JsonSerializerOptions JsonSetting = new JsonSerializerOptions() {[......]继续阅读
Middleware example: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Tex[......]继续阅读
中间件示例: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using Syst[......]继续阅读
为了配置 Linux 免密登录,之前找到方法都是比较麻烦的,后面发现一种只需要两个步骤就能完成免密登录配置的方法。 假如,在 Linux A 免密登录 Linux B。 那么在 A 上生成 私钥公钥: ssh-keygen 生成后,将公钥推送到 B 中: ssh-copy-id <user&[......]继续阅读
为了配置 Linux 免密登录,之前找到的方法都是比较麻烦的,后面发现一种只需要两个步骤就能完成免密登录配置的方法。 假如,在 Linux A 免密登录 Linux B。 那么在 A 上生成 私钥公钥: ssh-keygen 生成后,将公钥推送到 B 中: ssh-copy-id <user[......]继续阅读
Windows 和 Linux 都会有一些隐藏的分区,例如 EFI、boot 等。在 Linux 中情况又复杂对得多,例如 Docker 映射的分区/卷等,ram 交换页文件等。 Linux 中 DriveType 嗨哟 Fixed、Ram、CD 等类型,如果要对其进行筛选,编写获取方法是一件较为麻[......] 继续阅读
Windows and Linux both have hidden partitions such as EFI, boot, etc. The situation in Linux is much more complex, for example, with Docker mapped par[......] 继续阅读
级联值和参数 <CascadingValue Value="@_grandValue" Name="GrandValue"> <Parent /> </CascadingValue> 当数据要从父子组件间流通时,我们有多种方法可以传递参数。但是如果[......] 继续阅读
Cascading Values and Parameters <CascadingValue Value="@_grandValue" Name="GrandValue"> <Parent /> </Cascadin[......]继续阅读
子组件无法直接向父组件传递数据,所以先在子组件定义回调事件,然后父组件引用子组件时,将父组件的方法绑定到子组件中,然后在子组件触发回调即可。 子组件 Child.razor : <input @bind="Value" /> <button @oncl[......]继续阅读
子组件无法直接向父组件传递数据,因此首先在子组件中定义一个回调事件。在父组件引用子组件时,将父组件的方法绑定到子组件中,然后在子组件触发回调即可。 子组件 Child.razor : <input @bind="Value" /> <button @onclic[......]继续阅读