登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情
代码拉取完成,页面将自动刷新
开源项目
>
WEB应用开发
>
Web开发框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
9.9K
Star
14.5K
Fork
4.2K
GVP
dotNET China
/
Furion
代码
Issues
0
Pull Requests
0
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
📝 发布 Furion v4.8.6 版本
已完成
#I6DQ57
百小僧
拥有者
创建于
2023-02-08 15:41
## 版本说明 发布 `Furion` 和 `Furion.Tools` 和 `Furion.Xunit` `v4.8.6` 版本,包含动态 `WebAPI`,粘土对象等诸多改进。 ## 本期更新 - **新特性** - [新增] 审计日志 `LoggingMonitor` 支持配置序列化属性命名规则 <sup>4.8.6.12</sup> <sup>⏱️2023.02.21</sup> [#I6GPUP](https://gitee.com/dotnetchina/Furion/issues/I6GPUP) - [新增] `Swagger` 请求授权失败后自动退出授权状态 <sup>4.8.6.12</sup> <sup>⏱️2023.02.20</sup> [!717](https://gitee.com/dotnetchina/Furion/pulls/717) - [新增] 粘土对象支持任何字符作为 `JSON/XML` 键 <sup>4.8.6.9</sup> <sup>⏱️2023.02.19</sup> [#note_16329657](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48#note_16329657) - [新增] **动态 `WebAPI` 自动检查路由是否包含重复参数,如果有自动修正而不是抛异常** <sup>4.8.6.5</sup> <sup>⏱️2023.02.17</sup> [5f15ea1](https://gitee.com/dotnetchina/Furion/commit/5f15ea1edd2e7793d86dd074ffbbecbebf7f683f) - [新增] `byte[]` 类型 `MD5` 加密/比较重载方法 <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [#I6F1NT](https://gitee.com/dotnetchina/Furion/issues/I6F1NT) - [新增] 动态 `WebAPI` 支持 `[RouteConstraint(":*")]` 路由约束 <sup>4.8.6.2</sup> <sup>⏱️2023.02.10</sup> [#I6E6JA](https://gitee.com/dotnetchina/Furion/issues/I6E6JA) - [新增] `Swagger` 启用登录后配置 `CheckUrl` 可获取本地存储的 `Authorization` 请求报文头 <sup>4.8.6.2</sup> <sup>⏱️2023.02.10</sup> [#I6E3LB](https://gitee.com/dotnetchina/Furion/issues/I6E3LB) - [新增] **多语言支持 `.json` 文件配置方式(推荐)** <sup>4.8.6</sup> <sup>⏱️2023.02.08</sup> [#I6DL71](https://gitee.com/dotnetchina/Furion/issues/I6DL71) [#I5DXKP](https://gitee.com/dotnetchina/Furion/issues/I5DXKP) - [新增] 定时任务 `IScheduler.[Try]UpdateDetail(builder => {})` 和 `IScheduler.[Try]UpdateTrigger(triggerId, builder => {})` 重载方法 <sup>4.8.6</sup> <sup>⏱️2023.02.08</sup> [6e43a54](https://gitee.com/dotnetchina/Furion/commit/6e43a542f1a7e10bf996c6e0179a40d434d8682e) - **突破性变化** - [升级] 适配 `.NET7.0.3` 和 `.NET6.0.14` <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [eecbf83](https://gitee.com/dotnetchina/Furion/commit/eecbf83b4e3340ec83d54f675f0fe4f6623b0d11) - [调整] **动态 `WebAPI` 生成路由 `[HttpMethod(template)]` 规则** <sup>4.8.5.7</sup> <sup>⏱️2023.02.03</sup> [#I6CLPT](https://gitee.com/dotnetchina/Furion/issues/I6CLPT) - **问题修复** - [修复] 规范化结果不带 `mini-profiler` 版本启动登录 `UI` 后不能传递 `headers` 问题 <sup>4.8.6.11</sup> <sup>⏱️2023.02.20</sup> [#I6G8IR](https://gitee.com/dotnetchina/Furion/issues/I6G8IR) - [修复] `Serve.Run()` 因 [#I6G02W](https://gitee.com/dotnetchina/Furion/issues/I6G02W) 更改导致不配置端口时出现异常无法启动问题 <sup>4.8.6.10</sup> <sup>⏱️2023.02.20</sup> [#I6G6AR](https://gitee.com/dotnetchina/Furion/issues/I6G6AR) - [修复] 粘土对象不支持 `数字` 作为 `JSON/XML` 键问题 <sup>4.8.6.9</sup> <sup>⏱️2023.02.19</sup> [#note_16329657](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48#note_16329657) - [修复] 动态 `WebAPI` 不支持嵌套继承 `[Route]` 特性问题 <sup>4.8.6.8</sup> <sup>⏱️2023.02.18</sup> [#I6CLPT](https://gitee.com/dotnetchina/Furion/issues/I6CLPT) - [修复] `Serve.Run(urls: "端口")` 设置端口在 `.NET6/7` 下发布后始终是 `80` 端口问题 <sup>4.8.6.6</sup> <sup>⏱️2023.02.18</sup> [#I6G02W](https://gitee.com/dotnetchina/Furion/issues/I6G02W) - [修复] 粘土对象不支持 `中文` 作为 `JSON/XML` 键问题 <sup>4.8.6.6</sup> <sup>⏱️2023.02.18</sup> [4961e01](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48) - [修复] 远程请求代理模式配置了 `WithEncodeUrl = false` 无效问题 <sup>4.8.6.4</sup> <sup>⏱️2023.02.16</sup> [89639ba](https://gitee.com/dotnetchina/Furion/commit/89639ba1db8a7df750d9bca66a887e252622b219) - [修复] 动态 `WebAPI` 自定义 `[HttpMethod(template)]` 之后生成错误路由 <sup>4.8.6.1</sup> <sup>⏱️2023.02.08</sup> [59fe53b](https://gitee.com/dotnetchina/Furion/commit/59fe53b5a9715ed139aff9075cb7fcaad01565b7) - **其他更改** - [调整] 脱敏处理 `sensitive-words.txt` 嵌入文件支持 `UTF8 BOM` 编码,感谢 [@man119](https://gitee.com/man119) <sup>4.8.6.7</sup> <sup>⏱️2023.02.18</sup> [#I6G1JN](https://gitee.com/dotnetchina/Furion/issues/I6G1JN) - [调整] `Serve.Run()` 迷你主机默认添加 `JSON` 中文乱码处理 <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [86b5f9f](https://gitee.com/dotnetchina/Furion/commit/86b5f9f7c2ace503312bf879dccd7add12bd93c4) - **文档** - [新增] **多语言 `.json` 配置方式文档** - [更新] 日志文档、定时任务文档、动态 `WebAPI` 文档,规范化结果文档,`App` 静态类文档,`Oops` 静态类文档、虚拟文件系统文档 [!704](https://gitee.com/dotnetchina/Furion/pulls/704),远程请求文档,序列化文档、入门文档、脱敏模块文档 - **贡献者** - Andy ([@man119](https://gitee.com/man119)) - liuhll ([@liuhll2](https://gitee.com/liuhll2)) - 大柚 ([@big-pomelo](https://gitee.com/big-pomelo)) - WR_YT ([@wr-yt](https://gitee.com/wr-yt)) ## 本期亮点 **1. 新增定时任务更新作业信息和作业触发器方法** - 更新作业信息 ```cs showLineNumbers {2,8} // 返回 ScheduleResult 类型 var scheduleResult = Scheduler.TryUpdateDetail(jobBuilder => { jobBuilder.SetDescription("~~~"); }, out var jobDetail); // 无返回值 scheduler.UpdateDetail(jobBuilder => { jobBuilder.SetDescription("~~~"); }); ``` - 更新作业触发器 ```cs showLineNumbers {2,8} // 返回 ScheduleResult 类型 var scheduleResult = scheduler.TryUpdateTrigger("triggerId", triggerBuilder => { triggerBuilder.SetDescription("~~"); }, out var trigger); // 无返回值 scheduler.UpdateTrigger("triggerId", triggerBuilder => { triggerBuilder.SetDescription("~~"); }); ``` ----- **2. 新增多语言 `.json` 文件配置支持** [https://furion.baiqian.ltd/docs/local-language#2111-基于-json-文件多语言](https://furion.baiqian.ltd/docs/local-language#2111-基于-json-文件多语言)    ```cs L.Text["Furion"]; // => 如果设置为英文,但是没有文件,则直接输出 “Furion” ``` ----- **3. 动态 `WebAPI` 路由规则小调整** 在过去,`TestMethod` 生成路由为:`/mytest` ```cs showLineNumbers {1,4} // 注意这里没有 [Route] 特性 public class ClassService: IDynamicApiController { [HttpPost("mytest")] public void TestMethod() { } } ``` 新版本:`TestMethod` 生成路由为:`/api/class/mytest`,`TestMethod2` 生成路由为:`/mytest`。 ```cs showLineNumbers {1,4,9} // 注意这里没有 [Route] 特性 public class ClassService: IDynamicApiController { [HttpPost("mytest")] public void TestMethod() { } [HttpPost("/mytest")] public void TestMethod2() { } } ``` 也就是新版本如果不需要自动添加前缀,需在前面添加 `/`,旧版本不需要。 ----- **4. 动态 `WebAPI` 路由约束 `[RouteConstraint(":*")]` 支持** ```cs public class TestService: DynamicApiController { // 生成的路由为:/api/test/catch-all1/{*path} [HttpGet] public string CatchAll1([RouteConstraint(":*")] string path) { return path; } // 生成的路由为:/api/test/aaa/bbb/ccc/{*path} [HttpGet("aaa/bbb/ccc")] public string CatchAll2([RouteConstraint(":*")] string path) { return path; } // 生成的路由为:/aaa/bbb/ccc/{*path} [HttpGet("/aaa/bbb/ccc/{*path}")] public string CatchAll3(string path) { return path; } } ``` ----- **5. 新增 `MD5` 加密支持 `byte[]` 类型参数** ```cs // Furion 4.8.6.3+ 版本支持 byte[] 类型,如获取文件 MD5 Hash var bytes = File.ReadAllBytes("image.png"); var md5Hash = MD5Encryption.Encrypt(bytes); // 加密 var isEqual = MD5Encryption.Compare(bytes, md5Hash); // 比较 ``` ----- **6. 支持路由模板带重复参数** ```cs public class WithClass : IDynamicApiController { [HttpGet("system/role/deptTree/{roleId}")] // 过去版本抛异常,Furion 4.8.6.5+ 正常~ public string GetResult2(string roleId) { return nameof(Furion); } } ``` **过去版本会抛异常,新版本不会。**  ----- **7. 粘土对象支持任何字符作为键** ```cs // 数字作为键 var str = "{\"data\": {\r\n \"16347413030322\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var a = Clay.Parse(str); var a1 = a["data"]["16347413030322"]["componentType"]; Console.WriteLine(a1); // 中文作为键 var str1 = "{\"data\": {\r\n \"中文\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var b = Clay.Parse(str1); var b1 = b["data"]["中文"]["componentType"]; Console.WriteLine(b1); // 符号作为键 var str2 = "{\"data\": {\r\n \"~\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var c = Clay.Parse(str2); var c1 = c["data"]["~"]["componentType"]; Console.WriteLine(c1); // 大杂烩作为键 var str3 = "{\"data\": {\r\n \"^123,中文~,!\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var d = Clay.Parse(str3); var d1 = c["data"]["^123,中文~,!"]["componentType"]; Console.WriteLine(d1); ```  ## 文档更新 
## 版本说明 发布 `Furion` 和 `Furion.Tools` 和 `Furion.Xunit` `v4.8.6` 版本,包含动态 `WebAPI`,粘土对象等诸多改进。 ## 本期更新 - **新特性** - [新增] 审计日志 `LoggingMonitor` 支持配置序列化属性命名规则 <sup>4.8.6.12</sup> <sup>⏱️2023.02.21</sup> [#I6GPUP](https://gitee.com/dotnetchina/Furion/issues/I6GPUP) - [新增] `Swagger` 请求授权失败后自动退出授权状态 <sup>4.8.6.12</sup> <sup>⏱️2023.02.20</sup> [!717](https://gitee.com/dotnetchina/Furion/pulls/717) - [新增] 粘土对象支持任何字符作为 `JSON/XML` 键 <sup>4.8.6.9</sup> <sup>⏱️2023.02.19</sup> [#note_16329657](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48#note_16329657) - [新增] **动态 `WebAPI` 自动检查路由是否包含重复参数,如果有自动修正而不是抛异常** <sup>4.8.6.5</sup> <sup>⏱️2023.02.17</sup> [5f15ea1](https://gitee.com/dotnetchina/Furion/commit/5f15ea1edd2e7793d86dd074ffbbecbebf7f683f) - [新增] `byte[]` 类型 `MD5` 加密/比较重载方法 <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [#I6F1NT](https://gitee.com/dotnetchina/Furion/issues/I6F1NT) - [新增] 动态 `WebAPI` 支持 `[RouteConstraint(":*")]` 路由约束 <sup>4.8.6.2</sup> <sup>⏱️2023.02.10</sup> [#I6E6JA](https://gitee.com/dotnetchina/Furion/issues/I6E6JA) - [新增] `Swagger` 启用登录后配置 `CheckUrl` 可获取本地存储的 `Authorization` 请求报文头 <sup>4.8.6.2</sup> <sup>⏱️2023.02.10</sup> [#I6E3LB](https://gitee.com/dotnetchina/Furion/issues/I6E3LB) - [新增] **多语言支持 `.json` 文件配置方式(推荐)** <sup>4.8.6</sup> <sup>⏱️2023.02.08</sup> [#I6DL71](https://gitee.com/dotnetchina/Furion/issues/I6DL71) [#I5DXKP](https://gitee.com/dotnetchina/Furion/issues/I5DXKP) - [新增] 定时任务 `IScheduler.[Try]UpdateDetail(builder => {})` 和 `IScheduler.[Try]UpdateTrigger(triggerId, builder => {})` 重载方法 <sup>4.8.6</sup> <sup>⏱️2023.02.08</sup> [6e43a54](https://gitee.com/dotnetchina/Furion/commit/6e43a542f1a7e10bf996c6e0179a40d434d8682e) - **突破性变化** - [升级] 适配 `.NET7.0.3` 和 `.NET6.0.14` <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [eecbf83](https://gitee.com/dotnetchina/Furion/commit/eecbf83b4e3340ec83d54f675f0fe4f6623b0d11) - [调整] **动态 `WebAPI` 生成路由 `[HttpMethod(template)]` 规则** <sup>4.8.5.7</sup> <sup>⏱️2023.02.03</sup> [#I6CLPT](https://gitee.com/dotnetchina/Furion/issues/I6CLPT) - **问题修复** - [修复] 规范化结果不带 `mini-profiler` 版本启动登录 `UI` 后不能传递 `headers` 问题 <sup>4.8.6.11</sup> <sup>⏱️2023.02.20</sup> [#I6G8IR](https://gitee.com/dotnetchina/Furion/issues/I6G8IR) - [修复] `Serve.Run()` 因 [#I6G02W](https://gitee.com/dotnetchina/Furion/issues/I6G02W) 更改导致不配置端口时出现异常无法启动问题 <sup>4.8.6.10</sup> <sup>⏱️2023.02.20</sup> [#I6G6AR](https://gitee.com/dotnetchina/Furion/issues/I6G6AR) - [修复] 粘土对象不支持 `数字` 作为 `JSON/XML` 键问题 <sup>4.8.6.9</sup> <sup>⏱️2023.02.19</sup> [#note_16329657](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48#note_16329657) - [修复] 动态 `WebAPI` 不支持嵌套继承 `[Route]` 特性问题 <sup>4.8.6.8</sup> <sup>⏱️2023.02.18</sup> [#I6CLPT](https://gitee.com/dotnetchina/Furion/issues/I6CLPT) - [修复] `Serve.Run(urls: "端口")` 设置端口在 `.NET6/7` 下发布后始终是 `80` 端口问题 <sup>4.8.6.6</sup> <sup>⏱️2023.02.18</sup> [#I6G02W](https://gitee.com/dotnetchina/Furion/issues/I6G02W) - [修复] 粘土对象不支持 `中文` 作为 `JSON/XML` 键问题 <sup>4.8.6.6</sup> <sup>⏱️2023.02.18</sup> [4961e01](https://gitee.com/dotnetchina/Furion/commit/4961e01486f604db12a8d8d71f9bd563ed7d7d48) - [修复] 远程请求代理模式配置了 `WithEncodeUrl = false` 无效问题 <sup>4.8.6.4</sup> <sup>⏱️2023.02.16</sup> [89639ba](https://gitee.com/dotnetchina/Furion/commit/89639ba1db8a7df750d9bca66a887e252622b219) - [修复] 动态 `WebAPI` 自定义 `[HttpMethod(template)]` 之后生成错误路由 <sup>4.8.6.1</sup> <sup>⏱️2023.02.08</sup> [59fe53b](https://gitee.com/dotnetchina/Furion/commit/59fe53b5a9715ed139aff9075cb7fcaad01565b7) - **其他更改** - [调整] 脱敏处理 `sensitive-words.txt` 嵌入文件支持 `UTF8 BOM` 编码,感谢 [@man119](https://gitee.com/man119) <sup>4.8.6.7</sup> <sup>⏱️2023.02.18</sup> [#I6G1JN](https://gitee.com/dotnetchina/Furion/issues/I6G1JN) - [调整] `Serve.Run()` 迷你主机默认添加 `JSON` 中文乱码处理 <sup>4.8.6.3</sup> <sup>⏱️2023.02.15</sup> [86b5f9f](https://gitee.com/dotnetchina/Furion/commit/86b5f9f7c2ace503312bf879dccd7add12bd93c4) - **文档** - [新增] **多语言 `.json` 配置方式文档** - [更新] 日志文档、定时任务文档、动态 `WebAPI` 文档,规范化结果文档,`App` 静态类文档,`Oops` 静态类文档、虚拟文件系统文档 [!704](https://gitee.com/dotnetchina/Furion/pulls/704),远程请求文档,序列化文档、入门文档、脱敏模块文档 - **贡献者** - Andy ([@man119](https://gitee.com/man119)) - liuhll ([@liuhll2](https://gitee.com/liuhll2)) - 大柚 ([@big-pomelo](https://gitee.com/big-pomelo)) - WR_YT ([@wr-yt](https://gitee.com/wr-yt)) ## 本期亮点 **1. 新增定时任务更新作业信息和作业触发器方法** - 更新作业信息 ```cs showLineNumbers {2,8} // 返回 ScheduleResult 类型 var scheduleResult = Scheduler.TryUpdateDetail(jobBuilder => { jobBuilder.SetDescription("~~~"); }, out var jobDetail); // 无返回值 scheduler.UpdateDetail(jobBuilder => { jobBuilder.SetDescription("~~~"); }); ``` - 更新作业触发器 ```cs showLineNumbers {2,8} // 返回 ScheduleResult 类型 var scheduleResult = scheduler.TryUpdateTrigger("triggerId", triggerBuilder => { triggerBuilder.SetDescription("~~"); }, out var trigger); // 无返回值 scheduler.UpdateTrigger("triggerId", triggerBuilder => { triggerBuilder.SetDescription("~~"); }); ``` ----- **2. 新增多语言 `.json` 文件配置支持** [https://furion.baiqian.ltd/docs/local-language#2111-基于-json-文件多语言](https://furion.baiqian.ltd/docs/local-language#2111-基于-json-文件多语言)    ```cs L.Text["Furion"]; // => 如果设置为英文,但是没有文件,则直接输出 “Furion” ``` ----- **3. 动态 `WebAPI` 路由规则小调整** 在过去,`TestMethod` 生成路由为:`/mytest` ```cs showLineNumbers {1,4} // 注意这里没有 [Route] 特性 public class ClassService: IDynamicApiController { [HttpPost("mytest")] public void TestMethod() { } } ``` 新版本:`TestMethod` 生成路由为:`/api/class/mytest`,`TestMethod2` 生成路由为:`/mytest`。 ```cs showLineNumbers {1,4,9} // 注意这里没有 [Route] 特性 public class ClassService: IDynamicApiController { [HttpPost("mytest")] public void TestMethod() { } [HttpPost("/mytest")] public void TestMethod2() { } } ``` 也就是新版本如果不需要自动添加前缀,需在前面添加 `/`,旧版本不需要。 ----- **4. 动态 `WebAPI` 路由约束 `[RouteConstraint(":*")]` 支持** ```cs public class TestService: DynamicApiController { // 生成的路由为:/api/test/catch-all1/{*path} [HttpGet] public string CatchAll1([RouteConstraint(":*")] string path) { return path; } // 生成的路由为:/api/test/aaa/bbb/ccc/{*path} [HttpGet("aaa/bbb/ccc")] public string CatchAll2([RouteConstraint(":*")] string path) { return path; } // 生成的路由为:/aaa/bbb/ccc/{*path} [HttpGet("/aaa/bbb/ccc/{*path}")] public string CatchAll3(string path) { return path; } } ``` ----- **5. 新增 `MD5` 加密支持 `byte[]` 类型参数** ```cs // Furion 4.8.6.3+ 版本支持 byte[] 类型,如获取文件 MD5 Hash var bytes = File.ReadAllBytes("image.png"); var md5Hash = MD5Encryption.Encrypt(bytes); // 加密 var isEqual = MD5Encryption.Compare(bytes, md5Hash); // 比较 ``` ----- **6. 支持路由模板带重复参数** ```cs public class WithClass : IDynamicApiController { [HttpGet("system/role/deptTree/{roleId}")] // 过去版本抛异常,Furion 4.8.6.5+ 正常~ public string GetResult2(string roleId) { return nameof(Furion); } } ``` **过去版本会抛异常,新版本不会。**  ----- **7. 粘土对象支持任何字符作为键** ```cs // 数字作为键 var str = "{\"data\": {\r\n \"16347413030322\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var a = Clay.Parse(str); var a1 = a["data"]["16347413030322"]["componentType"]; Console.WriteLine(a1); // 中文作为键 var str1 = "{\"data\": {\r\n \"中文\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var b = Clay.Parse(str1); var b1 = b["data"]["中文"]["componentType"]; Console.WriteLine(b1); // 符号作为键 var str2 = "{\"data\": {\r\n \"~\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var c = Clay.Parse(str2); var c1 = c["data"]["~"]["componentType"]; Console.WriteLine(c1); // 大杂烩作为键 var str3 = "{\"data\": {\r\n \"^123,中文~,!\": {\r\n \"componentType\": \"@ali/tdmod-od-pc-offer-discount\",\r\n \"trackInfo\": {},\r\n \"data\": {\r\n \"couponList\": [{ \"couponType\": \"CARD\", \"couponContent\": \"1件混批\" }],\r\n \"pageName\": \"Page_GetCoupon\"\r\n }\r\n }\r\n }\r\n}"; var d = Clay.Parse(str3); var d1 = c["data"]["^123,中文~,!"]["componentType"]; Console.WriteLine(d1); ```  ## 文档更新 
评论 (
10
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
百小僧
monksoul
负责人
协作者
+负责人
+协作者
标签
优化
建议
新功能
未设置
标签管理
里程碑
v4.8.6
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(3)
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册