api接口加上默认域名
This commit is contained in:
@@ -1099,13 +1099,18 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController
|
|||||||
|
|
||||||
try
|
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)
|
switch (entity.RequestMethod)
|
||||||
{
|
{
|
||||||
case "6":
|
case "6":
|
||||||
result = (await entity.Path.SetHeaders(dicHerader).SetQueries(dic).GetAsStringAsync()).ToObject<JObject>();
|
result = (await tempPath.SetHeaders(dicHerader).SetQueries(dic).GetAsStringAsync()).ToObject<JObject>();
|
||||||
break;
|
break;
|
||||||
case "7":
|
case "7":
|
||||||
result = (await entity.Path.SetHeaders(dicHerader).SetBody(dic).PostAsStringAsync()).ToObject<JObject>();
|
result = (await tempPath.SetHeaders(dicHerader).SetBody(dic).PostAsStringAsync()).ToObject<JObject>();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user