diff --git a/Communications/Base.cs b/Communications/Base.cs
index c1d7f6d..64d5726 100644
--- a/Communications/Base.cs
+++ b/Communications/Base.cs
@@ -129,4 +129,24 @@ namespace YYApi.Communications
///
public T Data { get; set; }
}
+
+
+ //===========》请求《===============
+
+ ///
+ /// 只有ID的请求
+ ///
+ public class IdOnlyRequest
+ {
+ public int Id { get; set; }
+ }
+
+ ///
+ /// 基础分页请求
+ ///
+ public class BasePageRequest
+ {
+ public int Page { get; set; }
+ public int Count { get; set; }
+ }
}
\ No newline at end of file
diff --git a/Extensions.cs b/Extensions.cs
index ebaf2f2..7c05a23 100644
--- a/Extensions.cs
+++ b/Extensions.cs
@@ -32,7 +32,7 @@ namespace YYApi
public static IServiceCollection AddYYApi(this IServiceCollection builder, string title,
string description = null)
{
- return builder.AddAuth().AddApiDoc(title, description);
+ return builder.AddAuth().AddApiDoc(title, description).AddCors();
}
///
@@ -138,7 +138,12 @@ namespace YYApi
public static IApplicationBuilder UseYYApiMiddleware(this IApplicationBuilder builder, string title = "API文档",
params SubmitMethod[] submitMethods)
{
- return builder.UseExceptionMiddleware().UseApiDoc(title, submitMethods).UseMiddleware();
+ return builder.UseExceptionMiddleware().UseApiDoc(title, submitMethods).UseMiddleware().UseCors(x =>
+ {
+ x.AllowAnyHeader();
+ x.AllowAnyMethod();
+ x.AllowAnyOrigin();
+ }); ;
}
}
}
\ No newline at end of file
diff --git a/YYApi.csproj b/YYApi.csproj
index a8421ea..c52780e 100644
--- a/YYApi.csproj
+++ b/YYApi.csproj
@@ -4,7 +4,7 @@
netcoreapp3.1
Library
true
- 0.2.1
+ 0.2.3
xRain@YYTech
AspNetCore一个方便的API文档,捕获异常,统一输入输出的API类库
YY-Tech.YYApi