api接口加上默认域名
This commit is contained in:
@@ -1099,13 +1099,18 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController
|
||||
|
||||
try
|
||||
{
|
||||
string tempPath = entity.Path;
|
||||
if (!string.IsNullOrEmpty(tempPath) && !tempPath.StartsWith("http"))
|
||||
{
|
||||
tempPath = $"{App.HttpContext.Request.Scheme}://{App.HttpContext.Request.Host}{tempPath}";
|
||||
}
|
||||
switch (entity.RequestMethod)
|
||||
{
|
||||
case "6":
|
||||
result = (await entity.Path.SetHeaders(dicHerader).SetQueries(dic).GetAsStringAsync()).ToObject<JObject>();
|
||||
result = (await tempPath.SetHeaders(dicHerader).SetQueries(dic).GetAsStringAsync()).ToObject<JObject>();
|
||||
break;
|
||||
case "7":
|
||||
result = (await entity.Path.SetHeaders(dicHerader).SetBody(dic).PostAsStringAsync()).ToObject<JObject>();
|
||||
result = (await tempPath.SetHeaders(dicHerader).SetBody(dic).PostAsStringAsync()).ToObject<JObject>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user