Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63dcd0f13f | ||
|
|
22704590f5 |
@@ -4,15 +4,24 @@ namespace SimApi.Configs
|
||||
{
|
||||
public class SimApiOptions
|
||||
{
|
||||
public bool EnableCors { get; set; } = true;
|
||||
public bool EnableCors { get; set; } = false;
|
||||
|
||||
public bool EnableSimApiAuth { get; set; } = false;
|
||||
public bool EnableSimApiDoc { get; set; } = true;
|
||||
public bool EnableSimApiException { get; set; } = true;
|
||||
|
||||
public bool EnableSimApiDoc { get; set; } = false;
|
||||
|
||||
public bool EnableSimApiException { get; set; } = false;
|
||||
|
||||
public bool EnableSimApiStorage { get; set; } = false;
|
||||
public bool EnableForwardHeaders { get; set; } = true;
|
||||
public bool EnableLowerUrl { get; set; } = true;
|
||||
public bool EnableLogger { get; set; } = true;
|
||||
|
||||
public bool EnableForwardHeaders { get; set; } = false;
|
||||
|
||||
public bool EnableLowerUrl { get; set; } = false;
|
||||
|
||||
public bool EnableLogger { get; set; } = false;
|
||||
|
||||
public SimApiDocOptions SimApiDocOptions { get; set; } = new SimApiDocOptions();
|
||||
|
||||
public SimApiStorageOptions SimApiStorageOptions { get; set; } = new SimApiStorageOptions();
|
||||
|
||||
|
||||
|
||||
+11
-9
@@ -10,11 +10,22 @@ namespace SimApi.Helpers
|
||||
{
|
||||
public static class SimApiUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前CST时间
|
||||
/// </summary>
|
||||
public static DateTime CstNow
|
||||
{
|
||||
get => DateTime.UtcNow.AddHours(8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前秒级时间戳
|
||||
/// </summary>
|
||||
public static double TimestampNow
|
||||
{
|
||||
get => (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检测手机号是否正确
|
||||
/// </summary>
|
||||
@@ -58,14 +69,5 @@ namespace SimApi.Helpers
|
||||
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取 CST 当前时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DateTime GetCstNow()
|
||||
{
|
||||
return CstNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
<Folder Include="Configurations\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Minio" Version="4.0.2" />
|
||||
<PackageReference Include="Minio" Version="4.0.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.3.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user