Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web Development
>
Web Framework
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
9.5K
Star
14.5K
Fork
4.2K
GVP
dotNET China
/
Furion
Code
Issues
0
Pull Requests
0
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
622
发布 Furion v4.6.5 版本
Merged
dotNET China:dev-#I5VPD1
dotNET China:v4
百小僧
create on 2022-10-14 14:24
Clone/Download
HTTPS
SSH
Copy
Email Patch
Diff file
### 相关的 Issue [https://gitee.com/dotnetchina/Furion/issues/I5VPD1](https://gitee.com/dotnetchina/Furion/issues/I5VPD1) ### 功能描述 发布 `Furion` 和 `Furion.Tools` 和 `Furion.Xunit` `v4.6.5` 版本 包含以下功能更新: ### 功能清单 - [x] 新增 **`long` 序列化丢精度的 `JsonConvert` 内置转换器,`.AddLongTypeConverters()`** <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 新增 `app.EnableBuffering()` 拓展,解决 `Request.Body` 不能重复读问题 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 移除 ~~`DateOnlyJsonConverter` 和 `DateOnlyOffsetJsonConverter` 处理~~ <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 调整 **~~`.AddDateFormatString()`~~ 名称为 `.AddDateTimeTypeConverters()`** <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 修复 `.ToDictionary()` 拓展不支持 `JObject` 类型问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [a11bf8d](https://github.com/MonkSoul/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) - [x] 修复 `LoggingMonitor` 处理 `long` 类型丢精度问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 内置 `Microsoft.AspNetCore.Mvc.NewtonsoftJson` 拓展,原因是太多人使用了 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 升级 `SqlSugar` 拓展包和脚手架至 `5.1.3.27` 版本 - [x] 发布 `v4.6.5` 版本文档 - [x] 更新示例项目 `samples` 依赖至 `v4.6.5` 版本 - [x] [Replit](https://replit.com/) 网站 `Furion` 案例同步到 `v4.6.5` 版本 - [x] `Gitee` 和 `Github` 发布 `Release-v4.6.5` 版本 - [x] 同步更新日志 ### 代码实现 [https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) [https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6](https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) ### 文档更新 1. **内置 `long` 序列化丢精度处理** 有时候我们需要将 ` long` 类型序列化时转为 `string` 类型,防止 `JavaScript` 出现精度溢出问题,这个时候可以尝试使用以下方法解决: - `System.Text.Json` 方式 ```cs showLineNumbers {2,4} services.AddControllersWithViews() .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.AddLongTypeConverters(); }); ``` - `Newtonsoft.Json` 方式 ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` ----- 2. **关于 `Dictionary<,>` 类型包含 `long` 处理** 默认情况下,`System.Text.Json` 不支持 `Dictionary<,>` 类型的序列化设置 `Converter` 操作,这个时候可以换成 `Newtonsoft.Json` 处理,如: ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` 同时创建 `NewtonsoftJsonSerializerProvider.cs` 文件写入即可: ```cs showLineNumbers namespace YourProject.Core; public class NewtonsoftJsonSerializerProvider : IJsonSerializerProvider, ISingleton { public string Serialize(object value, object jsonSerializerOptions = null) { return JsonConvert.SerializeObject(value, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public T Deserialize<T>(string json, object jsonSerializerOptions = null) { return JsonConvert.DeserializeObject<T>(json, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public object GetSerializerOptions() { return App.GetOptions<MvcNewtonsoftJsonOptions>()?.SerializerSettings; } } ```
This pull request needs to pass some approval items
Type
Assign personnel
Status
Reviewer
百小僧
Pass review
Completed
(1/1 )
Tester
百小僧
Pass test
Completed
(1/1 )
How to merge Pull Request
git checkout v4
git pull https://gitee.com/dotnetchina/Furion.git dev-#I5VPD1
git push origin v4
Comments
0
Commits
1
Files
26+
Checks
Code problems
0
Bulk operation
Expand
Collapse
Reviewer
Code Owner
Reviewer
dotNET China
chinadotnet
百小僧
monksoul
诺墨
normalcoder
张辉
zhanghuiii
No Setting
Min number
1
Tester
dotNET China
chinadotnet
百小僧
monksoul
诺墨
normalcoder
张辉
zhanghuiii
No Setting
Min number
1
Priority
Not specified
Serious
Main
Secondary
Unimportant
Label
Label settings
漏洞
重大调整
优化
新功能
Link Issue
I5VJHC
粘土对象 todictionary 方法 返回前端的 long类型精度丢失
I5VPD1
📝 发布 Furion v4.6.5 版本
Successfully merged pull requests will close issues
Milestone
No related milestones
v4.7.9
v4.8.0
v4.8.1
v4.8.2
v4.8.3
v4.8.4
v4.8.5
v4.8.6
v4.8.7
v4.8.8
v4.9.0
Participators
(1)
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register