| | |
| | | /// <returns></returns> |
| | | private static AuthorizeFunRetEntity ValidateLicenseForDev(string filePath, ValidateLicenseInput input, AuthorizeFunRetEntity newRet) |
| | | { |
| | | var str_expiryDate = ""; |
| | | if (!string.IsNullOrEmpty(newRet.expiryDate)) |
| | | { |
| | | str_expiryDate = Convert.ToDateTime(newRet.expiryDate).ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | //读取 开发授权 |
| | | var val = EnDecode.ValidateDevLicense(filePath); |
| | | if (val.IsValid) |
| | |
| | | if (input != null && input.WaringDays != null) |
| | | { |
| | | int waringDays = (int)input.WaringDays; |
| | | if (waringDays >= val.RemainingDays) |
| | | double _my_RemainingDays = Convert.ToDouble(val.RemainingDays.ToString("0.0")); |
| | | if (waringDays >= _my_RemainingDays) |
| | | { |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, $"授权剩余天数{val.RemainingDays}小于{waringDays}天"); |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, $"授权剩余天数{_my_RemainingDays}小于{waringDays}天,到期日[{str_expiryDate}]"); |
| | | } |
| | | } |
| | | return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, newRet); |
| | | } |
| | | else |
| | | return AuthorizeFunRetEntity.Fail("授权失败", val.RemainingDays, newRet); |
| | | |
| | | { |
| | | if (string.IsNullOrEmpty(newRet.expiryDate)) |
| | | { |
| | | return AuthorizeFunRetEntity.Fail($"授权失败", val.RemainingDays, newRet); |
| | | } |
| | | return AuthorizeFunRetEntity.Fail($"授权失败,到期日[{str_expiryDate}]", val.RemainingDays, newRet); |
| | | } |
| | | } |
| | | |
| | | } |