schangxiang@126.com
2025-04-03 1d67f77e838df88b0223083378fb3381e691b4ae
优化
已修改3个文件
27 ■■■■■ 文件已修改
Api/Entity/AuthorizeFunRetEntity.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/Properties/launchSettings.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/Util/AuthorizeHelper.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/Entity/AuthorizeFunRetEntity.cs
@@ -89,7 +89,7 @@
            {
                result = true,
                resMsg = _resMsg,
                remainingDays = _remainingDays,
                remainingDays = Convert.ToDouble(_remainingDays.ToString("0.0")),
                expiryDate = newFun.expiryDate,
                issueDate = newFun.issueDate,
@@ -110,7 +110,7 @@
            {
                result = true,
                resMsg = _resMsg,
                remainingDays = _remainingDays,
                remainingDays = Convert.ToDouble(_remainingDays.ToString("0.0")),
                warnMsg = _warnMsg
            };
        }
@@ -141,7 +141,7 @@
            {
                result = false,
                resMsg = _resMsg,
                remainingDays = _remainingDays,
                remainingDays = Convert.ToDouble(_remainingDays.ToString("0.0")),
                expiryDate = newFun.expiryDate,
                issueDate = newFun.issueDate,
Api/Properties/launchSettings.json
@@ -4,8 +4,8 @@
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:5006",
      "sslPort": 5006
      "applicationUrl": "http://localhost:7777",
      "sslPort": 7777
    }
  },
  "profiles": {
@@ -14,7 +14,7 @@
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "swagger",
      "applicationUrl": "http://localhost:5006",
      "applicationUrl": "http://localhost:7777",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
@@ -24,7 +24,7 @@
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "swagger",
      "applicationUrl": "https://localhost:7205;http://localhost:5006",
      "applicationUrl": "https://localhost:7205;http://localhost:7777",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
Api/Util/AuthorizeHelper.cs
@@ -61,6 +61,12 @@
        /// <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)
@@ -68,9 +74,10 @@
                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}天,到期日{newRet.expiryDate}");
                        return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, $"授权剩余天数{_my_RemainingDays}小于{waringDays}天,到期日[{str_expiryDate}]");
                    }
                }
                return AuthorizeFunRetEntity.Success("成功", val.RemainingDays, newRet);
@@ -81,7 +88,7 @@
                {
                    return AuthorizeFunRetEntity.Fail($"授权失败", val.RemainingDays, newRet);
                }
                return AuthorizeFunRetEntity.Fail($"授权失败,到期日{newRet.expiryDate}", val.RemainingDays, newRet);
                return AuthorizeFunRetEntity.Fail($"授权失败,到期日[{str_expiryDate}]", val.RemainingDays, newRet);
            }
        }