云商品增加分组
This commit is contained in:
1 parent
861732ab7f
commit
8a85c3365b
11 files changed
+622
-109
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user