Skip to content

Commit 4686a92

Browse files
committed
更新1.3.0
1 parent c6bef2c commit 4686a92

30 files changed

+698
-165
lines changed

Admin.Core.Common/Admin.Core.Common.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6-
<Version>1.2.0</Version>
6+
<Version>1.3.0</Version>
77
<Authors>xiaoxue</Authors>
88
<Company>xiaoxue</Company>
99
<Description>中台Admin后端通用库</Description>
@@ -30,9 +30,9 @@
3030
<PackageReference Include="FreeSql.Provider.SqlServer" Version="1.5.0-preview0509" />
3131
<PackageReference Include="FreeSql.Repository" Version="1.5.0-preview0509" />
3232
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
33-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.3" />
34-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
35-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.3" />
33+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.4" />
34+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.4" />
35+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.4" />
3636
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.5.1" />
3737
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
3838
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.5.1" />
File renamed without changes.

Admin.Core.Common/Auth/UserToken.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
using System.IdentityModel.Tokens.Jwt;
66
using Microsoft.IdentityModel.Tokens;
77
using Admin.Core.Common.Configs;
8+
using Admin.Core.Common.Attributes;
89

910
namespace Admin.Core.Common.Auth
1011
{
12+
[SingleInstance]
1113
public class UserToken : IUserToken
1214
{
1315
private readonly JwtConfig _jwtConfig;

Admin.Core.Common/Cache/CacheType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ namespace Admin.Core.Common.Cache
66
/// </summary>
77
public enum CacheType
88
{
9+
/// <summary>
10+
/// 内存缓存
11+
/// </summary>
912
Memory,
13+
/// <summary>
14+
/// Redis缓存
15+
/// </summary>
1016
Redis
1117
}
1218
}

Admin.Core.Common/Configs/AppConfig.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66
public class AppConfig
77
{
88
/// <summary>
9-
/// Swagger文档
9+
/// Api地址,默认 http://*:8888
1010
/// </summary>
11-
public bool Swagger { get; set; }
11+
public string Urls { get; set; } = "http://*:8888";
1212

1313
/// <summary>
14-
/// Api地址,默认 http://*:8888
14+
/// Swagger文档
1515
/// </summary>
16-
public string Urls { get; set; } = "http://*:8888";
16+
public bool Swagger { get; set; } = false;
1717

1818
/// <summary>
1919
/// Aop配置
2020
/// </summary>
21-
public AopConfig Aop { get; set; }
21+
public AopConfig Aop { get; set; } = new AopConfig();
2222

2323
/// <summary>
2424
/// 日志配置
2525
/// </summary>
26-
public LogConfig Log { get; set; }
26+
public LogConfig Log { get; set; } = new LogConfig();
2727

2828
/// <summary>
2929
/// 验证码配置
3030
/// </summary>
31-
public VarifyCodeConfig VarifyCode { get; set; }
31+
public VarifyCodeConfig VarifyCode { get; set; } = new VarifyCodeConfig();
3232
}
3333

3434
/// <summary>
@@ -39,7 +39,7 @@ public class AopConfig
3939
/// <summary>
4040
/// 事物
4141
/// </summary>
42-
public bool Transaction { get; set; }
42+
public bool Transaction { get; set; } = true;
4343
}
4444

4545
/// <summary>
@@ -50,7 +50,7 @@ public class LogConfig
5050
/// <summary>
5151
/// 操作日志
5252
/// </summary>
53-
public bool Operation { get; set; }
53+
public bool Operation { get; set; } = true;
5454
}
5555

5656
/// <summary>
@@ -61,6 +61,6 @@ public class VarifyCodeConfig
6161
/// <summary>
6262
/// 操作日志
6363
/// </summary>
64-
public string[] Font { get; set; }
64+
public string[] Font { get; set; } = { "Times New Roman", "Verdana", "Arial", "Gungsuh", "Impact" };
6565
}
6666
}

Admin.Core.Common/Configs/CacheConfig.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ public class CacheConfig
1212
/// <summary>
1313
/// 缓存类型
1414
/// </summary>
15-
public CacheType Type { get; set; }
15+
public CacheType Type { get; set; } = CacheType.Memory;
1616

1717
/// <summary>
1818
/// Redis配置
1919
/// </summary>
20-
public RedisConfig Redis { get; set; }
20+
public RedisConfig Redis { get; set; } = new RedisConfig();
2121
}
2222

23+
/// <summary>
24+
/// Redis配置
25+
/// </summary>
2326
public class RedisConfig
2427
{
2528
/// <summary>
2629
/// 连接字符串
2730
/// </summary>
28-
public string ConnectionString { get; set; }
31+
public string ConnectionString { get; set; } = "127.0.0.1:6379,password=,defaultDatabase=2";
2932
}
3033
}

Admin.Core.Common/Configs/DbConfig.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ public class DbConfig
1111
/// <summary>
1212
/// 数据库类型
1313
/// </summary>
14-
public DataType Type { get; set; }
14+
public DataType Type { get; set; } = DataType.Sqlite;
1515

1616
/// <summary>
1717
/// 数据库字符串
1818
/// </summary>
19-
public string ConnectionString { get; set; }
19+
public string ConnectionString { get; set; } = "Data Source=|DataDirectory|\\admindb.db; Pooling=true;Min Pool Size=1";
2020

2121
/// <summary>
2222
/// 生成数据
2323
/// </summary>
24-
public bool GenerateData { get; set; }
24+
public bool GenerateData { get; set; } = false;
2525

2626
/// <summary>
2727
/// 同步结构
2828
/// </summary>
29-
public bool SyncStructure { get; set; }
29+
public bool SyncStructure { get; set; } = true;
3030

3131
/// <summary>
3232
/// 同步数据
3333
/// </summary>
34-
public bool SyncData { get; set; }
34+
public bool SyncData { get; set; } = true;
3535

3636
/// <summary>
3737
/// 建库
3838
/// </summary>
39-
public bool CreateDb { get; set; }
39+
public bool CreateDb { get; set; } = true;
4040

4141
/// <summary>
4242
/// 建库连接字符串
@@ -51,11 +51,11 @@ public class DbConfig
5151
/// <summary>
5252
/// 监听所有操作
5353
/// </summary>
54-
public bool MonitorCommand { get; set; }
54+
public bool MonitorCommand { get; set; } = false;
5555

5656
/// <summary>
5757
/// 监听Curd操作
5858
/// </summary>
59-
public bool Curd { get; set; }
59+
public bool Curd { get; set; } = false;
6060
}
6161
}

Admin.Core.Common/Configs/JwtConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ public class JwtConfig
1111
/// <summary>
1212
/// 发行者
1313
/// </summary>
14-
public string Issuer { get; set; }
14+
public string Issuer { get; set; } = "http://127.0.0.1:8888";
1515

1616
/// <summary>
1717
/// 订阅者
1818
/// </summary>
19-
public string Audience { get; set; }
19+
public string Audience { get; set; } = "http://127.0.0.1:8888";
2020

2121
/// <summary>
2222
/// 密钥
2323
/// </summary>
24-
public string SecurityKey { get; set; }
24+
public string SecurityKey { get; set; } = "ertJKl#521*a@790asD&1#";
2525

2626
/// <summary>
2727
/// 有效期(分钟)
2828
/// </summary>
29-
public int Expires { get; set; }
29+
public int Expires { get; set; } = 120;
3030
}
3131
}

0 commit comments

Comments
 (0)