feat: 扩展动态api统一前缀

This commit is contained in:
陈淳
2024-04-19 17:00:50 +08:00
parent 6bfcccfbb6
commit e92dd48bbf
3 changed files with 5 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ namespace Yi.Framework.AspNetCore.Mvc
var controllerNameInUrl =
NormalizeUrlControllerName(rootPath, controllerName, action, httpMethod, configuration);
var url = $"{apiRoutePrefix}/{rootPath}/{NormalizeControllerNameCase(controllerNameInUrl, configuration)}";
var url = $"{rootPath}/{NormalizeControllerNameCase(controllerNameInUrl, configuration)}";
//Add {id} path if needed
var idParameterModel = action.Parameters.FirstOrDefault(p => p.ParameterName == "id");

View File

@@ -72,7 +72,7 @@ namespace Yi.Framework.AspNetCore.Mvc
var template = selector.AttributeRouteModel.Template;
if (!template.StartsWith("/"))
{
var route = $"{AbpAspNetCoreConsts.DefaultApiPrefix}/{rootPath}/{template}";
var route = $"{rootPath}/{template}";
selector.AttributeRouteModel.Template = route;
}