From 2aa6ffae020b4dab66ac30ee4436346aa15ff3cb Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期二, 15 七月 2025 17:26:54 +0800 Subject: [PATCH] 修复绑定解绑可能导致的信息丢失问题 --- device/SnapManager.cs | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/device/SnapManager.cs b/device/SnapManager.cs index 4b48790..5dee262 100644 --- a/device/SnapManager.cs +++ b/device/SnapManager.cs @@ -22,10 +22,11 @@ // SNAP DateTime now = DateTime.Now; - string path = Settings.CaptureUrl; - string fileName = string.Format("{0}{1}{2}{3}{4}{5}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second) + ".jpg"; + //string path = Settings.CaptureUrl; + string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"StaticStorage/image/{now.Year}/{now.Month}/{now.Day}"); + string fileName = string.Format("{0}-{1}-{2}-{3}{4}{5}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second) + ".jpg"; string filePath = path + "\\" + fileName; - + string url = Path.Combine(Settings.WebApiUrl, $"static/image/{now.Year}/{now.Month}/{now.Day}", fileName); //// 鑾峰彇褰撳墠鏃堕棿 //DateTime now = DateTime.Now; @@ -42,13 +43,16 @@ //string filePath = Path.Combine(directoryPath, fileName); if (_snapDevice.SnapPictureToFileOK(ref filePath)) { - return filePath; + //return filePath; + return url; } else { return string.Empty; } } + // 澶ф鐜囩敤涓嶅埌锛屽簲璇ヤ笉鏄湰鍦版姄鍥撅紝鍙彲鑳芥槸缃戠粶鎶撳浘锛屽浘鐗囦繚瀛樺埌鍚庡彴 + public static string GetCapturePictureLocal() { return _snapDevice.GetCapturePictureLocalPath(); } -- Gitblit v1.9.1