| | |
| | | using iWare.Authorize.Dto; |
| | | using Newtonsoft.Json; |
| | | using ProjectCode; |
| | | |
| | | namespace iWare.Authorize |
| | |
| | | string rst = EnDecode.ReadAndValidateLicenseFile(firstFile.FullName); |
| | | if (!string.IsNullOrEmpty(rst)) |
| | | { |
| | | AuthorizeFunRetEntity newRet = JsonConvert.DeserializeObject<AuthorizeFunRetEntity>(rst); |
| | | if (EnDecode.ValidatePermanentLicense(firstFile.FullName)) |
| | | { |
| | | return AuthorizeFunRetEntity.Success("成功"); |
| | | return AuthorizeFunRetEntity.Success("成功", newRet); |
| | | } |
| | | else |
| | | return ValidateLicenseForDev(firstFile.FullName, input); |
| | | return ValidateLicenseForDev(firstFile.FullName, input, newRet); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="filePath"></param> |
| | | /// <returns></returns> |
| | | private static AuthorizeFunRetEntity ValidateLicenseForDev(string filePath, ValidateLicenseInput input) |
| | | private static AuthorizeFunRetEntity ValidateLicenseForDev(string filePath, ValidateLicenseInput input, AuthorizeFunRetEntity newRet) |
| | | { |
| | | //读取 开发授权 |
| | | var val = EnDecode.ValidateDevLicense(filePath); |
| | |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, $"授权剩余天数{val.RemainingDays}小于{waringDays}天"); |
| | | } |
| | | } |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays); |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, newRet); |
| | | } |
| | | else |
| | | return AuthorizeFunRetEntity.Fail("授权失败", val.RemainingDays); |
| | | return AuthorizeFunRetEntity.Fail("授权失败", val.RemainingDays, newRet); |
| | | |
| | | } |
| | | |