云商品增加分组

This commit is contained in:
chfei committed 2026-11-10 15:10:47 +08:00
1 parent 861732ab7f
commit 8a85c3365b
11 files changed
+622 -109

No files matched your search

+4 -2
View File
@@ -131,8 +131,10 @@ public sealed class ApiTransport
private HttpItem CreateRequest(string route, MethodType method, object body,
IDictionary<string, string> query, int timeoutMilliseconds)
{
if (string.IsNullOrWhiteSpace(route) ||
!Regex.IsMatch(route, @"\A[A-Za-z0-9_-]+(/[A-Za-z0-9_-]+)*\z"))
string pathOnly = route?.Split('?', '#')[0];
if (string.IsNullOrWhiteSpace(pathOnly) ||
!Regex.IsMatch(pathOnly, @"\A[A-Za-z0-9_-]+(/[A-Za-z0-9_-]+)*\z"))
throw new ArgumentException("接口必须使用相对路由,例如 Auth/Login。", nameof(route));
if (body != null) Validator.ValidateObject(body, new ValidationContext(body), true);
if (timeoutMilliseconds <= 0) throw new ArgumentOutOfRangeException(nameof(timeoutMilliseconds));