From 1d67f77e838df88b0223083378fb3381e691b4ae Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周四, 03 4月 2025 08:31:46 +0800
Subject: [PATCH] 优化

---
 Api/Entity/AuthorizeFunRetEntity.cs |    6 +++---
 Api/Properties/launchSettings.json  |    8 ++++----
 Api/Util/AuthorizeHelper.cs         |   13 ++++++++++---
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/Api/Entity/AuthorizeFunRetEntity.cs b/Api/Entity/AuthorizeFunRetEntity.cs
index 69ab548..f264f58 100644
--- a/Api/Entity/AuthorizeFunRetEntity.cs
+++ b/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,
diff --git a/Api/Properties/launchSettings.json b/Api/Properties/launchSettings.json
index 2363ebb..fc3afe6 100644
--- a/Api/Properties/launchSettings.json
+++ b/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"
       }
diff --git a/Api/Util/AuthorizeHelper.cs b/Api/Util/AuthorizeHelper.cs
index df116b5..b59e150 100644
--- a/Api/Util/AuthorizeHelper.cs
+++ b/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);
             }
         }
 

--
Gitblit v1.9.3