授权更改
This commit is contained in:
@@ -4,6 +4,7 @@ using CapMachine.Core.IService;
|
||||
using CapMachine.Wpf.MapperProfile;
|
||||
using CapMachine.Wpf.Models;
|
||||
using CapMachine.Wpf.Services;
|
||||
using CapMachine.Wpf.SoftAuthorizeCore;
|
||||
using CapMachine.Wpf.ViewModels;
|
||||
using CapMachine.Wpf.Views;
|
||||
using FreeSql;
|
||||
@@ -33,6 +34,7 @@ namespace CapMachine.Wpf
|
||||
private ILogService LogService { get; set; }
|
||||
|
||||
private static System.Threading.Mutex mutex;
|
||||
private SoftAuthorizeHelper SoftAuthorizeHelper { get; set; } = SoftAuthorizeHelper.GetInstance();
|
||||
|
||||
public App()
|
||||
{
|
||||
@@ -83,6 +85,26 @@ namespace CapMachine.Wpf
|
||||
this.Shutdown();
|
||||
}
|
||||
|
||||
|
||||
//验证文档
|
||||
try
|
||||
{
|
||||
var MachineCode = SoftAuthorizeHelper.GetMachineCode();
|
||||
SoftAuthorizeHelper.WriteMachineCodeToFile(MachineCode, "");
|
||||
var PublicKey = SoftAuthorizeHelper.GetPublicKeyDataByFilePath("");
|
||||
var Lience = SoftAuthorizeHelper.GetLienceDataByFilePath("");
|
||||
var IsOK = SoftAuthorizeHelper.CheckLience(MachineCode, PublicKey, Lience);
|
||||
if (!IsOK)
|
||||
{
|
||||
LogService.Error("授权失败");
|
||||
this.Shutdown();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
//base.OnStartup(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user