@@ -3,5 +3,10 @@ | |||
<appSettings> | |||
<add key="SM2PublicKey" value="04BD62406DF6789B1FBE8C457AECAE6D7C806CDB39316F190519905C24DF395E8952C47798D76ADECF8CA28C935702AFCDD9B17DE77121FA6448F0EDEFBD8365D6"/> | |||
<add key="SM2PrivateKey" value="00F908E5ED9C2059A960E3A58056F69E0CF75299182CEB93B74CD1FDC633FCA0E5"/> | |||
<add key="SXAPIURL" value="https://api.deepeleph.com"/> | |||
<add key="AppKey" value="Pep50sPYdY"/> | |||
<add key="AppSecret" value="36000f41-f13c-458b-a29b-59938359e58e"/> | |||
<add key="PoiId" value="001"/> | |||
<add key="TenantCode" value="quanjiang"/> | |||
</appSettings> | |||
</configuration> |
@@ -1,4 +1,5 @@ | |||
using SafeAuthActivate.Sm; | |||
using System.Configuration; | |||
namespace SafeAuthActivate | |||
{ | |||
@@ -35,7 +36,12 @@ namespace SafeAuthActivate | |||
} | |||
} | |||
var code = CryptogramUtil.Sm2Encrypt(hardwareId + "$" + time); | |||
Console.Write("请输入PoiId:"); | |||
var PoiId = Console.ReadLine(); | |||
Console.Write("请输入TenantCode:"); | |||
var TenantCode = Console.ReadLine(); | |||
var code = CryptogramUtil.Sm2Encrypt( | |||
$"{hardwareId}${time}${ConfigurationManager.AppSettings["SXAPIURL"]}${ConfigurationManager.AppSettings["AppKey"]}${ConfigurationManager.AppSettings["AppSecret"]}${PoiId}${TenantCode}"); | |||
Console.WriteLine("===============激活码生成成功请注意保存!====================="); | |||
Console.WriteLine(code); | |||
Console.WriteLine("=============================================================="); | |||
@@ -1,8 +1,4 @@ | |||
| |||
// | |||
using SafeCampus.Core.Options; | |||
using SafeCampus.Core.Options; | |||
namespace SafeCampus.Application; | |||
@@ -21,7 +17,7 @@ public class Startup : AppStartup | |||
{ | |||
//业务配置转实体 | |||
services.AddConfigurableOptions<ApplicationSettingsOptions>(); | |||
services.AddConfigurableOptions<AppInfoOptions>(); | |||
//services.AddConfigurableOptions<AppInfoOptions>(); | |||
services.AddConfigurableOptions<TXSmsOptions>(); | |||
} | |||
@@ -1,11 +1,5 @@ | |||
{ | |||
//秘钥配置 | |||
"Cryptogram": { | |||
//SM2国密配置 | |||
"SM2": { | |||
"PublicKey": "048A407FD953AD0318AAE08709EC6DF161BBB2A0A268DE20AFAC3C17131B046EEE6F1070F6DDC68066651F6BF6F2DC27ADFE11E78FDB4A042576F101E1BB999B0B", //公钥 | |||
"PrivateKey": "76DDFE59DFA9FF27CA73EF1BC9BF02C473FE1FA7D181083BE828BF93E02CE9BC" //私钥 | |||
} | |||
}, | |||
//日志配置 | |||
"Logging": { | |||
@@ -1,41 +1,63 @@ | |||
using Microsoft.Extensions.Configuration; | |||
using MoYu.ConfigurableOptions; | |||
using SafeCampus.Core.Utils; | |||
namespace SafeCampus.Core; | |||
public class AppInfoOptions : IConfigurableOptionsListener<AppInfoOptions> | |||
public class AppInfoOptions | |||
{ | |||
/// <summary> | |||
/// 深象智能API_Host | |||
/// </summary> | |||
public string SXAPIURL { get; set; } | |||
public string SXAPIURL { get; set; } = GetConfig(5); | |||
/// <summary> | |||
/// AppKey | |||
/// </summary> | |||
public string AppKey { get; set; } | |||
public string AppKey { get; set; } = GetConfig(6); | |||
/// <summary> | |||
/// AppSecret | |||
/// </summary> | |||
public string AppSecret { get; set; } | |||
public string AppSecret { get; set; } = GetConfig(7); | |||
/// <summary> | |||
/// 场所ID | |||
/// </summary> | |||
public string PoiId { get; set; } | |||
public string PoiId { get; set; } = GetConfig(8); | |||
/// <summary> | |||
/// 租户ID | |||
/// </summary> | |||
public string TenantCode { get; set; } | |||
public string TenantCode { get; set; } = GetConfig(9); | |||
public void PostConfigure(AppInfoOptions options, IConfiguration configuration) | |||
private static string GetConfig(int index) | |||
{ | |||
} | |||
var filePath = Path.Combine(App.HostEnvironment.ContentRootPath, "activation.config"); | |||
if (File.Exists(filePath)) | |||
{ | |||
var activationCode = File.ReadAllText(filePath); | |||
var yuanwen1 = Q3J5cHRvZ3JhbVV0aWw.U200RGVjcnlwdA(activationCode); | |||
var yuanwen2 = Q3J5cHRvZ3JhbVV0aWw.U20yRGVjcnlwdA(yuanwen1); | |||
if (!string.IsNullOrEmpty(yuanwen2)) | |||
{ | |||
var chaifen = yuanwen2.Split('$'); | |||
if (chaifen.Length == 9) | |||
{ | |||
return chaifen[index-1]; | |||
} | |||
} | |||
return ""; | |||
} | |||
public void OnListener(AppInfoOptions options, IConfiguration configuration) | |||
{ | |||
SXAPIURL = options.SXAPIURL; | |||
AppKey = options.AppKey; | |||
AppSecret = options.AppSecret; | |||
PoiId = options.PoiId; | |||
TenantCode = options.TenantCode; | |||
return ""; | |||
} | |||
//public void PostConfigure(AppInfoOptions options, IConfiguration configuration) | |||
//{ | |||
//} | |||
//public void OnListener(AppInfoOptions options, IConfiguration configuration) | |||
//{ | |||
// SXAPIURL = options.SXAPIURL; | |||
// AppKey = options.AppKey; | |||
// AppSecret = options.AppSecret; | |||
// PoiId = options.PoiId; | |||
// TenantCode = options.TenantCode; | |||
//} | |||
} |
@@ -8,12 +8,12 @@ public class U00yVXRpbA | |||
/// <summary> | |||
/// 公钥 | |||
/// </summary> | |||
public static string PublicKey = App.GetConfig<string>("Cryptogram:SM2:PublicKey"); | |||
public static string PublicKey = "04BD62406DF6789B1FBE8C457AECAE6D7C806CDB39316F190519905C24DF395E8952C47798D76ADECF8CA28C935702AFCDD9B17DE77121FA6448F0EDEFBD8365D6"; | |||
/// <summary> | |||
/// 私钥 | |||
/// </summary> | |||
public static string PrivateKey = App.GetConfig<string>("Cryptogram:SM2:PrivateKey"); | |||
public static string PrivateKey = "00F908E5ED9C2059A960E3A58056F69E0CF75299182CEB93B74CD1FDC633FCA0E5"; | |||
/// <summary> | |||
/// 公钥加密明文 | |||
@@ -10,18 +10,6 @@ | |||
"IsAutoCloseConnection": true, //是否自动释放 | |||
"IsUnderLine": false //是否驼峰转下划线 | |||
} | |||
// { | |||
// "ConfigId": "SafeCampus", //租户ID | |||
// "ConnectionString": "server=192.168.1.3;Database=SafeCampus;Uid=root;Pwd=123456;CharSet=utf8mb4;", //连接字符串 | |||
// "DbType": "MySql", //数据库类型 | |||
// "IsAutoCloseConnection": true, //是否自动释放 | |||
// }, | |||
// { | |||
// "ConfigId": "SafeCampus", //租户ID | |||
// "ConnectionString": "Server=192.168.1.16;Database=SafeCampus;User=sa;Password=123456;MultipleActiveResultSets=True;", //连接字符串 | |||
// "DbType": "SqlServer", //数据库类型 | |||
// "IsAutoCloseConnection": true, //是否自动释放 | |||
// } | |||
] | |||
} | |||
} |
@@ -44,7 +44,7 @@ public class ActivateAuthController : BaseController | |||
{ | |||
var yuanwen =Q3J5cHRvZ3JhbVV0aWw.U20yRGVjcnlwdA(activationCode); | |||
var chaifen = yuanwen.Split('$'); | |||
if (chaifen.Length!=4) | |||
if (chaifen.Length!=9) | |||
{ | |||
throw Oops.Oh("激活码错误!"); | |||
} | |||
@@ -40,7 +40,7 @@ public class SystemAuthorizeMiddleware | |||
if (!string.IsNullOrEmpty(yuanwen2)) | |||
{ | |||
var chaifen = yuanwen2.Split('$'); | |||
if (chaifen.Length == 4) | |||
if (chaifen.Length == 9) | |||
{ | |||
var isCorrect = DateTime.TryParse(chaifen[3], out var activeTime); | |||
if (isCorrect && chaifen[0] == await _machineUtil.GetProcessorId() && chaifen[1] == await _machineUtil.GetDiskId() && | |||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. | |||
<Project> | |||
<PropertyGroup> | |||
<_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl> | |||
<History>True|2024-12-10T01:50:44.2129205Z;True|2024-12-10T09:37:03.1127511+08:00;True|2024-12-09T13:47:34.5328594+08:00;True|2024-12-09T13:40:14.0307574+08:00;True|2024-12-09T13:37:06.9251645+08:00;True|2024-12-09T09:35:03.8007889+08:00;True|2024-12-05T17:55:26.3520105+08:00;True|2024-12-05T16:16:25.4547843+08:00;True|2024-12-05T15:40:26.7141856+08:00;True|2024-12-05T15:10:10.8427444+08:00;True|2024-12-04T17:22:28.7226032+08:00;True|2024-12-04T16:48:08.7253345+08:00;True|2024-12-04T13:36:58.9261836+08:00;True|2024-12-04T11:25:09.0287420+08:00;True|2024-12-04T10:49:03.6405687+08:00;True|2024-12-03T17:23:27.3622111+08:00;True|2024-12-03T17:04:39.8598677+08:00;True|2024-12-03T16:51:32.9879069+08:00;True|2024-12-03T16:43:48.1356230+08:00;True|2024-12-03T15:51:47.8248313+08:00;True|2024-11-22T11:28:53.1271820+08:00;True|2024-11-20T17:52:54.4158858+08:00;True|2024-11-20T17:26:43.3032818+08:00;True|2024-11-20T17:00:52.2470231+08:00;True|2024-11-20T13:48:46.8664181+08:00;True|2024-11-19T16:41:39.5873421+08:00;True|2024-11-19T16:11:53.2744549+08:00;True|2024-10-24T09:50:55.5191427+08:00;True|2024-10-24T09:34:12.7696084+08:00;True|2024-10-23T10:41:37.0558539+08:00;True|2024-10-23T09:28:31.4313071+08:00;True|2024-10-23T09:26:31.5501719+08:00;True|2024-10-23T09:23:51.0582343+08:00;True|2024-10-23T09:06:44.5849207+08:00;True|2024-10-22T13:08:17.1569031+08:00;True|2024-10-22T09:42:47.5945039+08:00;True|2024-10-21T17:29:20.3317104+08:00;True|2024-10-21T16:46:26.6984879+08:00;True|2024-10-21T10:12:44.0443975+08:00;True|2024-10-10T10:57:40.0075220+08:00;True|2024-10-10T10:02:41.0397715+08:00;True|2024-10-09T17:39:11.0140701+08:00;True|2024-10-09T17:18:07.5988076+08:00;True|2024-10-09T17:10:57.0818759+08:00;True|2024-10-09T17:08:07.1773134+08:00;True|2024-10-09T16:38:21.4832776+08:00;True|2024-10-09T16:31:58.3589164+08:00;True|2024-10-09T16:10:50.3337773+08:00;True|2024-10-09T10:39:55.8405182+08:00;True|2024-10-08T17:55:12.0035540+08:00;True|2024-10-08T16:48:00.5056466+08:00;True|2024-10-08T16:27:40.5071980+08:00;True|2024-10-08T16:24:26.2664694+08:00;True|2024-10-08T15:41:46.6016263+08:00;True|2024-09-30T17:07:19.0903067+08:00;True|2024-09-30T10:34:23.6203647+08:00;True|2024-09-29T14:44:27.0928205+08:00;True|2024-09-24T17:04:13.1154955+08:00;True|2024-09-23T14:58:29.0998917+08:00;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;True|2024-08-12T11:27:42.2864171+08:00;True|2024-08-09T14:54:42.9062124+08:00;True|2024-08-09T11:49:01.0339449+08:00;True|2024-08-09T11:43:21.9947939+08:00;True|2024-08-09T10:43:25.7641675+08:00;</History> | |||
<History>True|2024-12-13T08:46:33.9007060Z;True|2024-12-13T16:43:47.4243476+08:00;True|2024-12-13T16:32:31.6822178+08:00;False|2024-12-13T16:31:57.1463001+08:00;False|2024-12-13T16:31:24.3921316+08:00;True|2024-12-10T09:50:44.2129205+08:00;True|2024-12-10T09:37:03.1127511+08:00;True|2024-12-09T13:47:34.5328594+08:00;True|2024-12-09T13:40:14.0307574+08:00;True|2024-12-09T13:37:06.9251645+08:00;True|2024-12-09T09:35:03.8007889+08:00;True|2024-12-05T17:55:26.3520105+08:00;True|2024-12-05T16:16:25.4547843+08:00;True|2024-12-05T15:40:26.7141856+08:00;True|2024-12-05T15:10:10.8427444+08:00;True|2024-12-04T17:22:28.7226032+08:00;True|2024-12-04T16:48:08.7253345+08:00;True|2024-12-04T13:36:58.9261836+08:00;True|2024-12-04T11:25:09.0287420+08:00;True|2024-12-04T10:49:03.6405687+08:00;True|2024-12-03T17:23:27.3622111+08:00;True|2024-12-03T17:04:39.8598677+08:00;True|2024-12-03T16:51:32.9879069+08:00;True|2024-12-03T16:43:48.1356230+08:00;True|2024-12-03T15:51:47.8248313+08:00;True|2024-11-22T11:28:53.1271820+08:00;True|2024-11-20T17:52:54.4158858+08:00;True|2024-11-20T17:26:43.3032818+08:00;True|2024-11-20T17:00:52.2470231+08:00;True|2024-11-20T13:48:46.8664181+08:00;True|2024-11-19T16:41:39.5873421+08:00;True|2024-11-19T16:11:53.2744549+08:00;True|2024-10-24T09:50:55.5191427+08:00;True|2024-10-24T09:34:12.7696084+08:00;True|2024-10-23T10:41:37.0558539+08:00;True|2024-10-23T09:28:31.4313071+08:00;True|2024-10-23T09:26:31.5501719+08:00;True|2024-10-23T09:23:51.0582343+08:00;True|2024-10-23T09:06:44.5849207+08:00;True|2024-10-22T13:08:17.1569031+08:00;True|2024-10-22T09:42:47.5945039+08:00;True|2024-10-21T17:29:20.3317104+08:00;True|2024-10-21T16:46:26.6984879+08:00;True|2024-10-21T10:12:44.0443975+08:00;True|2024-10-10T10:57:40.0075220+08:00;True|2024-10-10T10:02:41.0397715+08:00;True|2024-10-09T17:39:11.0140701+08:00;True|2024-10-09T17:18:07.5988076+08:00;True|2024-10-09T17:10:57.0818759+08:00;True|2024-10-09T17:08:07.1773134+08:00;True|2024-10-09T16:38:21.4832776+08:00;True|2024-10-09T16:31:58.3589164+08:00;True|2024-10-09T16:10:50.3337773+08:00;True|2024-10-09T10:39:55.8405182+08:00;True|2024-10-08T17:55:12.0035540+08:00;True|2024-10-08T16:48:00.5056466+08:00;True|2024-10-08T16:27:40.5071980+08:00;True|2024-10-08T16:24:26.2664694+08:00;True|2024-10-08T15:41:46.6016263+08:00;True|2024-09-30T17:07:19.0903067+08:00;True|2024-09-30T10:34:23.6203647+08:00;True|2024-09-29T14:44:27.0928205+08:00;True|2024-09-24T17:04:13.1154955+08:00;True|2024-09-23T14:58:29.0998917+08:00;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;</History> | |||
<LastFailureDetails /> | |||
</PropertyGroup> | |||
</Project> |
@@ -1 +1 @@ | |||
54aca00e64a212dd59daad739ab315bf6ef507e46b07185d8e88381af8bd04d9d3f198c9bfa80545fceec2168a32c7207f98cb0af57fa571a9b1815d9e3adfabf8bd1a82bce5300ffc9646d3c4206c345d6cc4aa40a8c122e725695fbced6f089cd8ff2d6713bc2837994349b3e64a15715d321d93e761f81b252db8816cbf677a5fbdf01be51652427819d5600248c3586103113679a1216d5a2830fd1046dee46a1bc821298936ba1b486533c069419365ffd70cedbbf37420cb25306e0042d84acef12eb7d73dc9b4922cf990c271b44d8c3268a7eec42df06447d7123d67d80b220101dc68a3f65e2ef95275b5ff4f46d5d9868babd9dbb86bd5b8072e7f231b28692a1c508c913ce539da82794de9711df2b3fca0e1e6b19b02dc8d98a13ca77489c7aa47061b4393cb5db6e9bdbc4d7de1a2c1113bbc5323a74149741276505834bca6129c551136e8a80dea5c | |||
aa53c3b35bd1ebc638e8f41948636093507ff5d7279c1712c953c60306d7683e1d315ae736c065d5c43add3759ed22214e72584a117ce525a6f05e8420cdcf528c61afa24f41ae33355a1f550a4bc83a1e2cd2ccea2658bf4835292c33367a63550cafc1e2267048121a76b1536c1ee187f1f3ea211d51aff89480e3140d0f73bd4eb3f4a8f15f54734b4656b4c2f41ee9b54c6d4796d77ab012576f4ad0f35472ae8542c7364cb9d5bfc021f806d5be1ec176c70bbc62cd1608a8db65ac753c2bd8e7e2aa3d0e883bed4a42a771321b163a954919655ee1c65f93f0e76463b1fda0a2ed4171da65da57df126241bf69ece14ec9030162a692baf8408482c12a8e8e437ce3607aa2a5e52eca42a35a1f7019cc14472724d5e9212a0dbe29056912f94b807e66334bee8efdd297c4659e52e5a8bfca3e5b1c9d47950d3f494cfb59d5203107a1d01c073dbc128d675db8c400671edd6ec7e87759e2b7c5df9ed47d42859d979c7f1f82c8993f74946e3717b67b2d1ac0964cb2db9ac0c900b8730cf6dde8fcd3d914517193146b917e169b8f4a29f1eb80563b915057478283e3ba3f895ef794b56abb7439ccdcc5acc2f34098faf1ad81438bb034d082e579ae3d818e694aea29db9695712d96b59ddfbf222ee52d41c7e814101f97816910bcfe5bac9932b236153970d0a0c2a40bfec335d60c53cfde2bb52f5da8d11bc23ca544fa70f768cf72472f6a8fa04a3bb6 |
@@ -40,11 +40,6 @@ | |||
"seed_*.json" | |||
], | |||
"AppInfo": { | |||
"SXAPIURL": "https://api.deepeleph.com", | |||
"AppKey": "Pep50sPYdY", | |||
"AppSecret": "36000f41-f13c-458b-a29b-59938359e58e", | |||
"PoiId": "001", | |||
"TenantCode": "quanjiang", | |||
"AlarmImg": "alarmImg", | |||
"PersonImg": "personImg", | |||
"AttendanceImg": "attendanceImg", | |||